I am working on a CAF application in WM7.1 and my requirement is to log all application specific logs (debug, info, warn, fatal) in a separate application log file. I tried using my own log4j jar & log4.properties file within my CAF application but no information is getting logged (may be ClassLoader issue). I would appreciate all help on configuring logging in 7.1 CAF application using log4j. Some information I am looking are as below
Where to configure logger, appender & layout information. (is it log4j.init.properties file)
API to retrieve logger & log (debug, info, warn & fatal) messages from my CAF application.
Thanks Alex for the reply. But I can’t access the link. Even though I am registered with the internal sag forum, I can’t see any forum list. I guess you need to provide me access to the forum.
From: Norman, Eric
Sent: Wednesday, July 02, 2008 11:32 AM
To: Imel, Mark; RnD-wM-CAF-SWAT
Subject: RE: Do we have an example of log4j configuration for CAF Standalone apps?
Thanks Alex!!
I made it work by directly adding a named logger to log4j.init.properties file of MWS/server/config folder. It is working as expected (Not sure if it is recommended way…).
I did put my log4j.jar in WEB-INF/lib folder & log4j.properties in WEB-INF/classes folder in MWS server expecting the application Classloader to load the appropriate file but nothing was getting logged. I will give it a try again.
Anyways thanks for your prompt response and I really appreciate all your help.
We also use custom loggers for our applications.
A log4j jar file alredy exists by default in [b]webMethods7/common/lib/ext/log4j.jar[/b]. I [b]think [/b]MWS & IS uses this jar.
In order to use a custom logger for our applications we have made the following configurations:
- in the file [b]MyApp\WebContent\WEB-INF\web.xml[/b] add the following listener: