Servicely Administration
Scripting
Logger API
7 min
logging business api summary the logger functionality provides the ability to log application messages, the logger can be configured to log only messages if the desired logging level are set there are 5 levels of logging in servicely error warning info debug trace logging level the logging level can be set as part of the code where logging is been used basic configuration let mylogger = logger(“workflowlog”); by default these debug levels are set error (enabled) warning (enabled) info (enabled) advanced configuration let mylogger = logger(“workflowlog”); the log level can be set inside the script (java script code) with loglevel(“warn”) to have the ability to change log levels on demand or for a specific instance it can be configured in the servicely backend by navigating to administration => logging & statistics => system log level field description source name of the logger level debug level error warning info debug trace constructor method description logger(name string) creates a logger with the specified name methods method description loglevel() string returns the current log level as a string loglevel(level string) loggerobjectwrapper sets the logging level of the logger iserrorenabled() boolean used as a check to see if the error logging level has been enabled iswarnenabled() boolean used as a check to see if the warning logging level has been enabled isinfoenabled() boolean used as a check to see if the info logging level has been enabled isdebugenabled() boolean used as a check to see if the debug logging level has been enabled istraceenabled() boolean used as a check to see if the trace logging level has been enabled error(args array< >) used to log an error warn(args array< >) used to log a warning info(args array< >) used to log an info message debug(args array< >) used to log a debug message trace(args array< >) used to log a trace message