Skip to Content

SAP Logs & Traces: How to see the result of SimpleLogger.traceThrowable()

In my application I use SimpleLogger to write logs:

  1. SimpleLogger.log(int severity, Category category, Location location, String message, String messageID) — for non exceptions cases
  2. SimpleLogger.traceThrowable(int severity, Location location, String message, String messageID, Throwable exc) — for cases with exceptions

The first function works correctly, while SimpleLogger.traceThrowable() doesn't seem to be writing any log at all, at least I can't find any log with the exceptions, written by traceThrowable() on https://HOSTNAME:PORT/nwa/logs.

I checked and I can't spot any issue in my code.

Code snippet:

SimpleLogger.log(logSevLvl, logCat, logLoc, logMsgID, logMsg); //doesn't work
SimpleLogger.traceThrowable(logSevLvl, logLoc, logMsgID, logMsg, logExp);

Do you have any idea why I can't see any log, written by traceThrowable() in nwa/logs?

Add comment
10|10000 characters needed characters exceeded

  • Dear Mike,

    please note that I have changed the tags by removing Webservices Java and NWDI as I don't see the relation to that topic, and I moved NWA to the primary tags.

    Ervin (moderator)

  • Dear Ervin,

    thanks for keeping me updated.
    My project is developed in NWDS, and I assumed that the logging and tracing subject is tightly coupled with the infrastructure domain, since it serves the needs of maintainer to keep the core business process running, but barely has to do with the business process itself.

  • Follow
  • Get RSS Feed

1 Answer

  • Aug 09, 2018 at 08:43 AM

    Hello Mike,

    What log severity did You use? The issue may be that no logs generated on the set severity level or above. Try to change the severity to log more detailed information.


    Add comment
    10|10000 characters needed characters exceeded

    • To your initial question, I'm using Severity.ERROR to call the SimpleLogger.traceThrowable(). This severity level is enough to write the data with SimpleLogger.log().

      I tried to use the most detailed severity level, based on a documentation, — Severity.DEBUG, but it still doesn't work.

      Code snippet:

      Location.getLocation(MyClass.class.getName()), "NotificationText", "TEST TRACE", new Exception());