cancel
Showing results for 
Search instead for 
Did you mean: 

Apache commons logging in mobile application

Former Member
0 Kudos

Hello,

during a research project I try to include an add on in my mobile application. This add on uses <a href="http://jakarta.apache.org/commons/logging/">Apache commons logging</a> mechanism. There are no error messages at startup, but I cannot see the data logged by the add on, neither on the console nor in the ME trace file.

Does anybody know a workaround for this problem? I have to read the logs, because the add on is not working properly.

Best regards,

Andreas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Andreas

U can view the data in the client using

<b>

http://localhost:4444/<application name>/MainServlet?event=viewDirect</b>

bye

sid

give points if u feel tht this is useful

Former Member
0 Kudos

Hello everybody,

I forgot to mention that I use the AWT version of ME.

Additionally, for testing purposes, I just copied the jar-File of my addOn into the lib folder of my MI installation and added it to the listOfJars.txt. Therefore do not have an addons folder. Where could the lost logging messages have gone?

Kind regards,

Andreas

Former Member
0 Kudos

Somehow the Application did not care about what log level was set in the Mobile Engine. So I wrote an own class implementing the Log interface and configured the commons-logging to use it.

Certainly not the best way to solve this problem, but it worked.

Answers (2)

Answers (2)

Former Member
0 Kudos

hello andreas,

if you just want to add some logging/tracing functions

into your addon, i would suggest you to use the Trace

utility of MI. see the package com.sap.ip.me.api.logging

You can create an new instance of Trace class from

Trace.getInstance(componentname)

api, you can use your application name as the component

name parameter. this parameter will help you in filtering

logs specific to your application. in your addon you can

log something like:

Trace trc = Trace.getInstance("MYADDON");

if (trc.isLogging(Severities.DEBUG)) {

trc.log(Severities.DEBUG, "My Log Message");

}

you just then have to enable the trace of MI.

im not sure if this what you need though.

regards

jo

Former Member
0 Kudos

Hello Jo,

thank you for your advice. I know how to use MI Logging, but the addon I want to use is written by someone else and not limited to MI. It is released using commons-logging, so I have to deal with that, if I do not want to change every line of code concerned with logging.

kishorg
Advisor
Advisor
0 Kudos

Hi Andreas,

You can see the downloaded add-on files on the client device in the below specified folder --

<Driver>:\Program Files\SAP Mobile Infrastructure\addons\ in windows.

All the logs related with the installation of this add-on will be there in the log directory of your add-on.

The downloaded add-ons we can see in their folder structure within the folder specified. check it..

Regards

KIshor Gopinatan