on 03-18-2005 12:16 PM
Hi all,
i am using the SAP WAS 640 SP9 and want to use the SAP logging API in my app but it doesn´t work.
I configuered a log-configuration.xml and used the code examples from the help portal:
The following is a code snippet from a session bean
protected static final Location loc = Location.getLocation("de.pta.sap.was.ag.Node");
public List getSchueler(String name) throws ApplicationException{
String method = "announce(java.lang.Object)";
loc.entering(method);
List schuelerListe = null;
try {
loc.debugT(method, "Connecting to ");
setConnection();
...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-formatters>
<log-formatter
name="ag_formatter"
pattern="%24d %-60l %s: %m"
type="TraceFormatter"/>
</log-formatters>
<log-destinations>
<log-destination
effective-severity="DEBUG"
name="ag_app_log"
pattern="./log/anwendungen/ag/ag.log"
type="FileLog">
<formatter-ref
name="ag_formatter"/>
</log-destination>
<log-destination
name="ag_app_log_trace"
type="ConsoleLog"/>
</log-destinations>
<log-controllers>
<log-controller
effective-severity="DEBUG"
name="ag_controller">
<associated-destinations>
<destination-ref
association-type="LOG"
name="ag_app_log_trace"/>
<destination-ref
association-type="LOG"
name="ag_app_log"/>
</associated-destinations>
</log-controller>
</log-controllers>
</log-configuration>
The Visual Administrator only shows the the destination ag_app_log_trace (Services => Log Configurator => Locations) for the controller
ag_controller. I tried to add the the destination ag_app_log (which is shown at the destinations list) and saved but this shows no effect.
Every time i open the LogConfiguratior i get the old configuration and there is no log file build while testing the app.
Can anybody help me?
Thanks
Christian
Hi Christian,
You should name your log controller: /Applications/<your name>
instead of the name ag_controller use: /Applications/ag_controller
If you were using the tracing api (Locations), then you would have a name similar to this: com.sap.test
Where the class that is doing the tracing is in the com.sap.test package.
Hope this helps!
Cheers,
Jeff
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeff,
I found your logging and tracing pesentation and it is really helpful.
Trying to start the configtool i get the following error:
Secure Store lib Dir does not exist D:\usr\sap\J2E\SYS\global\security\lib\tools
The datybase settings are:
Secure Store File: D:\usr\sap\J2E\SYS\global\security\data\SecStore.properties
Secure Store Key File: D:\usr\sap\J2E\SYS\global\security\data\SecStore.key
System Name: J2E
Secure Store Lib: D:\usr\sap\J2E\SYS\global\security\lib
Rdbms connections: jdbc/pool/J2E
Rdbms driver location: D:\sapdb\programs\runtime\jar\sapdbc.jar
Rdbms initial connections: 1
Rdbms mx connections: 5
Thanks for Help
Christian
Hi Christian,
For tracing you need to name the controller the package name of the class you are going to tracing in. Instead of the controller name being ag_app_log_trace, it should be in your case: de.pta.sap.was.ag
Hopefully this fixes the problem you are having. There aren't any settings for using File Log...if this doesn't work I could email you a simple app that does work.
Cheers,
Jeff
Hi Christian,
I just sent you the simple logging App. For others out there who maybe interested here is a valid log-configuration.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-destinations>
<log-destination
count="3"
effective-severity="ERROR"
limit="1000"
name="TraceFile"
pattern="./log/applications/sap.com/j1/LoggingDemoApp/default.trc"
type="FileLog"/>
</log-destinations>
<log-controllers>
<log-controller
effective-severity="ERROR"
name="com.sap.j1.loggingdemo">
<associated-destinations>
<destination-ref
association-type="LOG"
name="TraceFile"/>
</associated-destinations>
</log-controller>
</log-controllers>
</log-configuration>
Hi Christian,
since SP4 of J2EE Engine 6.30 all trace message go into the defaultTrace.trc file.
See SAP Note 733903 how to change that. Only recommended for development!!
"This can be achieved by
modifying two properties of the "Log Manager" kernel component on the
respective cluster node.
If "ForceSingleTraceFile" is set to NO, then this functionality is
entirely disabled and the traces are redirected to the destinations
specified in the log-configuration.xml."
Regards, Karsten
Hi Karsten,
thanks for the advice. I found a similar hint at a presentation about logging and tracing written by Jeff Gebo but i´m faacing troubles starting the config tool. I always get an error trying to start thr tool. The error is described above (Secure Store lib Dir does not exist).
Any hint will be appreciated
Christian
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.