The Logging API lets you collect all info/error/debug information in a central trace file that can be viewed on the client or sent to the server for inspection by the administrator. With the logging information at hand, most application and framework problems can be analysed remotely by system administrators without them having physical access to the device.
MI logging generates two .log file, that are located under the /log folder of the <MI_Home> folder:
applog.txt
The entries into this log file are always generated (no activation necessary) and the file is sent to the server automatically when you synchronize. Entries in applog.txt are generated with the AppLog class and the severity level WARNING or higher. The applog.txt should contain information for the system administrator. So you can inform the system administrator about missing resources, that the system administrator than can assign for the device for the next Sync.trace.txt
The logging to this log file as well as the sending to the server when you synchronize has to be manually enabled under the Trace page of the MI home page. Entries in trace.txt are generated with the Trace class and AppLog class with the severity level lower than WARNING. The trace.txt is usually used to debug an application.
A log file entry contains:
Timestamp:
The time is in UTC format.Severity level:
W = Warning, F = Fatal, I = Information, D = Debug, E = Error.Message:
The message that was provided when creating the AppLog or Trace instance. If the entry has been generated by the MI itself, the message has the form "MI/Core", "MI/Security" etc. to indicate which part of the MI generated the log entry.
The logging API is fully contained in the class com.sap.ip.me.api.logging.AppLog. The interface Severities in the same package defines the constants for the trace levels.
To get an AppLog instance you have to supply a text string. The text string is displayed in the log/trace file. In the examples we use the name of the application (defined in getApplicationName). Log entries are generated in applog.txt (when the severity level is WARNING or higher) and in trace.txt.
The logging API is fully contained in the class com.sap.ip.me.api.logging.Trace. The interface Severities in the same package defines the constants for the trace levels.
To get an Trace instance you have to supply a text string. The text string is displayed in the log/trace file. In the examples we use the name of the application (defined in getApplicationName). Log entries are generated in trace.txt.
The MDK examples show the usage of AppLog and the Javadoc on the Logging API is very comprehensive and should answer all your questions.