How to enable/disable logging for a scoped application?

wolfgangb
Giga Contributor

I understand that gs.info() etc. allows scoped applications to write logs in defined verbosity levels. My question is how to enable or disable the logging of a specific scoped application?

Say I run an application 'MyApplication' that logs by using gs.info() and gs.error(), how can I disable the logging by configuration so that the application logs are no longer written to the application log table?

1 ACCEPTED SOLUTION

Hi Wolfgang,



Yes, you need to create these properties for each application you create. This is simple to do from within Studio.



For example, if I create an app x_snc_green, my property Suffix is "logging.destination", the name is automatically populated with the scope to become x_snc_green.logging.destination.



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you


View solution in original post

3 REPLIES 3

Chuck Tomasi
Tera Patron

Hi Wolfgang,



Each scope has it's own control over the verbosity and destination of the debug messages. These are logging.verbosity and logging.destination.



https://developer.servicenow.com/app.do#!/document/content/app_store_doc_scoped_script_jakarta_r_Sco...



You can turn the session debugging on and off from the Application page (System Applications> Application). Very handy for seeing things on the screen as you develop.


https://developer.servicenow.com/app.do#!/document/content/app_store_doc_scoped_script_jakarta_c_Sco...


Thanks for that great information. I just have one more question on that, if I search for those two properties within the sys_properties table I do not see any results. Are those two properties not present by default and I have to set them once I would like to disable logging for my application?


Hi Wolfgang,



Yes, you need to create these properties for each application you create. This is simple to do from within Studio.



For example, if I create an app x_snc_green, my property Suffix is "logging.destination", the name is automatically populated with the scope to become x_snc_green.logging.destination.



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you