hi there,
i just want to know,how will i make a log of my own for my own class and install it on the JBoss
as i already been able to do it in websphere with the log4j.properties its giving me no errors & simply making the html file in for my own entries
if anyone knows the answer
do give the explanation
-
Problem with log4j in JBoss (2 messages)
- Posted by: deep singh
- Posted on: November 24 2005 08:40 EST
Threaded Messages (2)
- Problem with log4j in JBoss by Debashish Ghosh on November 25 2005 14:45 EST
- Re : Problem with log4j in JBoss by deep singh on November 28 2005 01:23 EST
-
Problem with log4j in JBoss[ Go to top ]
- Posted by: Debashish Ghosh
- Posted on: November 25 2005 14:45 EST
- in response to deep singh
Deep ,
What I interpret from your query is that you want to create a seperate logger for your own Java Class . The simple solution to this is to Create a logger with Category as yourClassName and in the log4j.properties file assign the required appenders and layout to the corresponding category .
codeSnippet
Logger urClassLogger = Logger.getLogger("UrClassName");
Log4j.Properties
log4j.logger.UrClassName = Debug,A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.MaxFileSize=2MB
log4j.appender.A1.file=Out.log
log4j.appender.A1.layout=org.apache.log4j.UrHtmlLayout
Hope this helps.
Cheers
Deb -
Re : Problem with log4j in JBoss[ Go to top ]
- Posted by: deep singh
- Posted on: November 28 2005 01:23 EST
- in response to Debashish Ghosh
Hi Debashish,
Thanks for answering but,
what i really mean to say is i have made my own logger class with my own methods like entering(String str) /or exiting(String str) and everything like FileAppender & FileName /FileLayout every entry i have mentioned in log4j.properties file
Now when i am running it in Websphere application development studio it is sending the log to the Html File which i have defined
but when i am Deploying the application as an Ear in JBOSS it is not sending the log info. to the Html File that i have given but only producing that info in the server.log file
what i want is that it should redirect the log info to the file i have defined
answer if you know