on 12-12-2005 8:31 AM
I Developed an Adapter based on SAP sample adapter,
1. change the package in VERSION_ID to comply with my current package
2. change the log-configuration.xml to comply with my current package
3. in visual admin, change the severity to All
but the problem is : I still cannot see the trace, where it is outputted, I have seen many docs about tracing, i know that in the previous version 6.20, we need a properties file to configure like log4j, now in the new version 6.40 we need use log-configuration.xml, what else i can do for logging? I have asked such question in previous post, i think i resolved, but no, who can help me? now i used hard code for tracing using Location object and FileLog object in sap logging.
ref:log-configuration-xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-formatters>
<!-- This formatter produces human readable messages. -->
<log-formatter name="trc" pattern="%26d %150l [%t] %10s: %m" type="TraceFormatter"/>
</log-formatters>
<log-destinations>
<!-- Destination for Trace Information of this ra @class-package@ -->
<log-destination count="5" effective-severity="ALL" limit="2000000" name="default.trc"
pattern="./log/applications/@class-package@/default.trc" type="FileLog">
<formatter-ref name="trc"/>
</log-destination>
</log-destinations>
<log-controllers>
<!-- Trace Location @class-package@ -->
<log-controller name="@class-package@" effective-severity="ALL">
<associated-destinations>
<destination-ref association-type="LOG" name="default.trc"/>
</associated-destinations>
</log-controller>
<!-- Logging Category: none, we use the default XILog -->
</log-controllers>
</log-configuration>
ref: version-id
public static final String VERSION_ID = "$Id: //tc/aii/30_VAL_REL/src/_adapters/_myxiadapter/java/com/tangquan/aii/af/myxiadapter/adapter/ra/SPIManagedConnectionFactory.java#4 $";
Message was edited by: Spring Tang
Hi Spring,
try to use this as log-configuration.xml and change the
packagenames:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-formatters>
<!-- This formatter produces human readable messages. -->
<log-formatter name="trc" pattern="%26d %150l [%t] %10s: %m" type="TraceFormatter"/>
</log-formatters>
<log-destinations>
<!-- Destination for Trace Information of this ra com.sap.aii.af.sample.adapter.ra -->
<!-- this should be the path to your classes -->
<log-destination count="5" effective-severity="ALL" limit="2000000" name="default.trc"
pattern="./log/applications/com.COMPANY.aii.af.ADAPTERNAME.adapter.ra/default.trc" type="FileLog">
<formatter-ref name="trc"/>
</log-destination>
</log-destinations>
<log-controllers>
<!-- Trace Location com.sap.aii.af.sample.adapter.ra -->
<!-- this should be the path to your classes -->
<log-controller name="com.COMPANY.aii.af.ADAPTERNAME.adapter.ra" effective-severity="ALL">
<associated-destinations>
<destination-ref association-type="LOG" name="default.trc"/>
</associated-destinations>
</log-controller>
<!-- Logging Category: none, we use the default XILog -->
</log-controllers>
</log-configuration>
If your VERSION_ID is correct (it should look like this):
public static final String VERSION_ID = "$Id: //tc/aii/30_REL/src/_adapters/_ADAPTERNAME/java/com/COMPANY/aii/af/ADAPTERNAME/adapter/ra/SPIManagedConnectionFactory.java#6 $";
you should see log entries in the default.trc!
At least a deploy time some sample trace messages should be written...
I hope it helps,
best regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
package structure:
com.tangquan.aii.af.myxiadapter.adapter.ra
version-id:
public static final String VERSION_ID = "$Id: //tc/aii/30_VAL_REL/src/_adapters/_myxiadapter
/java/com/tangquan/aii/af/myxiadapter/adapter/ra
/SPIManagedConnectionFactory.java#4 $";
log-configuration.xml file exists in inner rar archive and outer sda archive:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log-configuration SYSTEM "log-configuration.dtd">
<log-configuration>
<log-formatters>
<!-- This formatter produces human readable messages. -->
<log-formatter name="trc" pattern="%26d %150l [%t] %10s: %m" type="TraceFormatter"/>
</log-formatters>
<log-destinations>
<!-- Destination for Trace Information of this ra com.tangquan.aii.af.myxiadapter.adapter.ra -->
<log-destination count="5" effective-severity="ALL" limit="2000000" name="default.trc"
pattern="./log/applications/com.tangquan.aii.af.myxiadapter.adapter.ra/default.trc" type="FileLog">
<formatter-ref name="trc"/>
</log-destination>
</log-destinations>
<log-controllers>
<!-- Trace Location com.tangquan.aii.af.myxiadapter.adapter.ra -->
<log-controller name="com.tangquan.aii.af.myxiadapter.adapter.ra" effective-severity="ALL">
<associated-destinations>
<destination-ref association-type="LOG" name="default.trc"/>
</associated-destinations>
</log-controller>
<!-- Logging Category: none, we use the default XILog -->
</log-controllers>
</log-configuration>
ps: where i put the log-configuration file, just under /meta-inf? I delployed sap sample adapter, I also did not see the trace.
could anyone help me?
Message was edited by: Spring Tang
Message was edited by: Spring Tang
Message was edited by: Spring Tang
f you want to see the log outputted in the file you specified in your log-configuration.xml file, In the visual admin, you need config the property ForceSingleFile of LogManager in Server/Kernel/LogManager to false, otherwise the all log will be outputted in the .log/defaulttrace.trc file by default
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.