FatFractal customer forums



Author Topic: Server extension logs  (Read 1467 times)

porter

  • Newbie
  • *
  • Posts: 8
    • View Profile
Server extension logs
« on: February 01, 2014, 04:51:19 PM »
I see there is a reference to this -- I think -- in the release notes for v1.2.

Any new info?  I'm looking for info on how to read print() statements from server extensions I've deployed up to FF.

Thanks!

kevin@fatfractal.com

  • Administrator
  • *****
  • Posts: 56
    • View Profile
Re: Server extension logs
« Reply #1 on: February 01, 2014, 09:38:10 PM »
Documentation is still in progress, but here is the source code for the server-side logger function...

Hope this helps.

Kevin

Code: [Select]
/**
 * Allows server-side code to log messages to the application's log with different severities (TRACE, INFO, WARN, ERROR).
 * <br>*** Does not increase your server-side API call count (unless you are LoggingToDatabase) ***
 * @type {{trace: Function, info: Function, warn: Function, error: Function, forceInfo: Function, forceWarn: Function}}
 */
var logger = {
    /** @param {String} msg */
    trace:  function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.trace(msg);},
    /** @param {String} msg */
    info:   function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.info(msg);},
    /** @param {String} msg */
    warn:   function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.warn(msg);},
    /** @param {String} msg */
    error:  function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.error(msg);},
    /** @param {String} msg */
    forceInfo:   function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.forceInfo(msg);},
    /** @param {String} msg */
    forceWarn:   function(msg) {if (typeof msg != 'string') throw new Error("Parameter must be a string"); else FF_JS_API.logger.forceWarn(msg);}
};
exports.logger = logger;

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Server extension logs
« Reply #2 on: February 02, 2014, 10:40:22 AM »
Hi Porter - see documentation of this feature here: http://fatfractal.com/prod/docs/custom-code/#server-side-logging

 

Copyright © FatFractal customer forums