GSLog : Logging not showing on syslog

Ram117
Kilo Sage

Experts,

I am using GSLog based logging on my custom application.  This is a snippet of the code which I am using

var processStaging = Class.create();
processStaging.prototype = {
    initialize: function () {

      
        this._jsUtil = global.JSUtil;
        this._arrayUtils = new global.ArrayUtil();
        this._logger = new global.GSLog('x_123_myApp.myApp_data_log_level',this.type);
        
    },

    processRecord: function (site, cust) {

           
        this._logger.logDebug('cust in the beginning ' + JSON.stringify(cust));
        this._logger.logInfo('Info here');

    }
	},

    type: 'processStaging'
};

 if I invoke this function from a background script , logging works correctly based on the logLevel set on the system property.  Issue I have is , none of these log entries shows up on syslog . 

Any guidance on this ?.

 

Thx

Ram.

2 REPLIES 2

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @Ram117 ,

You can refer below :-

 

The Scoped Logging API provides four levels of verbosity. In order from least verbose to most, they are:

 

Log Level Description
error (gs.error) Logs events that might still allow the application to continue running. Setting the log level for an application to error generates error messages only, but does not generate warn, info, or debug messages.
warn (gs.warn) Logs potentially harmful events. Setting the log level for an application to warn generates error and warn messages, but does not generate error or debug messages.
info (gs.info) Logs informational messages that describe the progress of the application. Setting the log level for an application to info generates info, warn, and error messages, but does not generate debug messages.
debug (gs.debug) Logs informational events that are useful for debugging an application. Setting the log level for an application to debug generates info, warn, error, and debug messages.

 

 

Best practice for scoped applications is to create two system properties to control the destination of verbosity of logging.



 

All scoped applications have two properties for control logging verbosity and destination. System properties are available by application for configuring log verbosity and destination, and for turning session debugging on or off:

 

Property Description
scope_name.logging.destination

Configuring the log destination: file system or db.


  • Type: String
  • Default value: db
  • Location: System Property [sys_properties] table
scope_name.logging.verbosity Configures log verbosity: error, warn, info, debug, or trace.
  • Type: String
  • Default value: info
  • Location: System Property [sys_properties] table
  •  

 

Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

@Gunjan Kiratkar  , I was not referring to the glide system log / info functions rather to the GSLog script include.

GSLog helps to control the level of logging which we need for debugging. I am having challenges in showing the log entries on the syslog table.