cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro trace & log

Former Member
0 Kudos

Hi All,

I'm trying to customize the webdynpro logger in design time.

I've created the log-configurator.xml and defined all its attributes. As for my understanding after deploying the project, all the locations\formatters are supposed to be in the visual admin console.

I also set the "SingleTraceFile" to NO.

Is there a step-by-step tutorial for this?

Why are my configurations aren't deployed?

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Aviad,

1) Read the WebLog /people/sap.user72/blog/2004/11/10/log-configuration-for-a-web-dynpro-application

2) Check whether the file log-configuration.xml is in the right directory within the deployed ear file. It must be stored in the meta-inf directory. There was a bug in the IDE which stored the file in the wrong directory. In case it is not correctly stored you must manually move it to the meta-inf directory.

Best Regards, Bertram

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

Configuring application logs:

Configuration is task for server administrator. create configuration file for each component. Right click on WebDynpro project and select "Create Log Configuration File". Click on the "Log Controller", select Log Controllers tree and Add new controller. Enter "Controller name" (according to location name you want to use in your application). (If you want to log language-independent messages use "Bundle name" to specify resource bundle.) Select Effective severity you want to use. You can also specify minimum and maximum severity to be used with this controller (server will not use severity out of this range).

Make sure that log-configuration.xml is placed inside META-INF directory of your EAR (or in descriptors directory of your SDA). If not then your log-configuration.xml will not be loaded into server configuration at deploy time.

All log message are stored in XML files.

You probably want separated XML file created for each application (or even each service). Go to the Log Formatter tab of your log-configuration.xml and Add new formatter into the root of tree. Set Name and Type appropriately. Then got to the Log Destination tab and Add new destination to the root of tree. Set Name, Type (FileLog) and Pattern (filename + path relative to c:\usr\sap\J2E\JC00\j2ee\cluster\server0\). Choose Formatter Reference to previously created formatter. In Log Controllers tab in the tree find Referenced Destinations and Add your destination associated to LOG (PUBLIC log in Visual administrator). You will probably do these things also in Visual Administrator (if log-configuration.xml isn't placed inside META-INF directory of your EAR). Even with this setting your deployed application will not work as expected until you set ForceSingleTraceFile=No and restart server.

Sample code

public void wdDoInit()

{

//@@begin wdDoInit()

final String method="wdDoInit()";

loc.entering(method);

if(loc.beDebug()){

Integer a=new Integer(1+1);

loc.debugT(method,"Result is {0}",new String[]{a.toString()});

}

loc.debugT("Just wasting time :-)");

if(loc.beError())

loc.errorT("xxx");

//sending problem to administrator

Category.APPS_COMMON_CONFIGURATION.errorT(loc,MessageE002);

loc.debugT(Category.APPS_COMMON_CONFIGURATION,"some message",new String[]{"debug"}); loc.warningT("qvradf"); loc.errorT(method,"Someone stole my data"); String storage="hard disk"; loc.errorT(method,"Data stolen from ",new String[]);

loc.fatalT(Category.SYS_DATABASE,method,MessageF007);

loc.exiting();

//@@end

}

//@@begin others

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

private static final String MessageE002 = "E002: Input parameter can't be handled.";

private static final String MessageF007 = "F007: Data stolen.";

//@@end

Regards

Suresh

Answers (0)