cancel
Showing results for 
Search instead for 
Did you mean: 

Logging doesn't work for J2EE App

Former Member
0 Kudos

Hi,

i've defined the following log config as XML in the .ear file of my app:

-


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">

<log-configuration>

<log-formatters>

<log-formatter

name="de.axentiv.hne.format"

pattern="%l %d %s %m"

type="TraceFormatter"/>

</log-formatters>

<log-destinations>

<log-destination

effective-severity="ALL"

name="de.axentiv.hne"

pattern="c:\jms.log"

type="FileLog">

<formatter-ref

name="de.axentiv.hne.format"/>

</log-destination>

</log-destinations>

<log-controllers>

<log-controller

minimum-severity="ALL"

name="de.axentiv.hne">

<associated-destinations>

<destination-ref

association-type="LOG"

name="de.axentiv.hne"/>

</associated-destinations>

</log-controller>

</log-controllers>

</log-configuration>

-


I retrieve the logger:

private static final Location loc = Location.getLocation(JmsTestServlet.class);

JmsTestServlet.class resides in the package de.axentiv.hne which corresponds to the log destination defined above.

My logging statement is:

loc.debugT("***> Sending message: Test");

Unfortunately there is no file at c:\jms.log which contains my log statement. Does anybody know what my problem here might be.

Regards in advance and thank's

Heiko

Accepted Solutions (0)

Answers (1)

Answers (1)

Jeff-Gebo
Advisor
Advisor
0 Kudos

Hi Heiko,

by default the logging api writes to a single trace file (defaultTrace.trc). This is done for performance reasons. At times though (and I would always suggest this on your local J2EE Engine), you want multiple trace files...one for each app.

I did a presentation on how to configure the J2EE Engine to do this. You can see the pdf of this presentation here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/using logging and tracing on the sap web as java.pdf

Hope this helps!

Cheers,

Jeff