When an error is output with "gs.error ()", an error with similar contents is output together.

__17
Tera Expert

I use "gs.error ()" to log the error when the condition corresponding to the error occurs in the server script.

However, another error was output with the same content as the one I created.
Message "*** Script: ~ Error details ~: no thrown error"
Source "com.glide.ui.ServletErrorListener"
How can I stop this?

By the way, if you output with "gs.info ()" instead of "gs.error ()", another error no longer appears.

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hey,

FOund this on support article by SN:

When 'gs.logError()' is called there's always a side effect of writing a source==com.glide.ui.ServletErrorListener error-level syslog record that duplicates the requested message.

  • In the server, the exception (Throwable <exception> t) is used to provide stack trace information to the logger in the backend/server. If there is no exception that was thrown (passed as a parameter ["Throwable t"] to the logging methods [error, warn]), then the logger will print "no thrown error", because there was no exception thrown/passed. If an exception was thrown (passed as a parameter), then a stack trace (generated/extracted from the exception) would be appended to '<message> + <exception class name>', and that would be printed instead of the <message> + ': no thrown error.'
  • What's happening is that the primary error message is logged, then the error message is logged again with the stack trace if an exception was thrown. When there is no exception, the log looks almost like a duplicate log entry because there is no stack trace to include. So, I believe the customer should always expect this behavior when using gs.logError().

Upon calling "gs.logError()" API, it creates duplicate error-level syslog records!!

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

 

 

Best Regards
Aman Kumar

View solution in original post

3 REPLIES 3

Aman Kumar S
Kilo Patron

Hey,

FOund this on support article by SN:

When 'gs.logError()' is called there's always a side effect of writing a source==com.glide.ui.ServletErrorListener error-level syslog record that duplicates the requested message.

  • In the server, the exception (Throwable <exception> t) is used to provide stack trace information to the logger in the backend/server. If there is no exception that was thrown (passed as a parameter ["Throwable t"] to the logging methods [error, warn]), then the logger will print "no thrown error", because there was no exception thrown/passed. If an exception was thrown (passed as a parameter), then a stack trace (generated/extracted from the exception) would be appended to '<message> + <exception class name>', and that would be printed instead of the <message> + ': no thrown error.'
  • What's happening is that the primary error message is logged, then the error message is logged again with the stack trace if an exception was thrown. When there is no exception, the log looks almost like a duplicate log entry because there is no stack trace to include. So, I believe the customer should always expect this behavior when using gs.logError().

Upon calling "gs.logError()" API, it creates duplicate error-level syslog records!!

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

 

 

Best Regards
Aman Kumar

Hi, Are you using gs.log() in different application scope..?

Mahesh23
Mega Sage
Hi, Are you using gs.log() in different application scope..?