Results 1 to 5 of 5
Thread: EJB Project using log4j
- 01-11-2012, 12:08 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
EJB Project using log4j
Hi All,
I have created a simple ejb project in netbeans. This displays the output "hello world" in the client side. I have created session bean and a remote interface in the server side and in the client side i have the main java program. I have used external depends like the log4j.jar and have created a log4j.properties file.
The problem is it doesnot generate the log file which I have specified in the log4j.properties file i,e d:/ejbbeanlogs.log.
My log4j.properties file is given below:
log4j.rootLogger = INFO, fileout
log4j.appender.fileout = org.apache.log4j.RollingFileAppender
log4j.appender.fileout.layout.ConversionPattern = %d %5p %c - %m%n
log4j.appender.fileout.layout = org.apache.log4j.PatternLayout
log4j.appender.fileout.File = D:/ejbbeanlogs.log
Please suggest the possible solutions.
Thanks in advance.
- 01-11-2012, 04:04 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: EJB Project using log4j
a) Have you initialized the logger properly? If you use System.out as an Appender does it log to the console?
b) Does your client application have permission to write to the D directory?
Provide an SSCCE that demonstrates logging and it 'now working'...
- 01-12-2012, 06:25 AM #3
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Re: EJB Project using log4j
Thank u for your response.
A) yup i have initialized log4j file properly and it logs to the console if i use a System.out as an appender. :)
B) ya client allows to write in the D directory.
If I run as a stand alone it works i mean it generates the log file.But not in the client side.
- 01-12-2012, 04:02 PM #4
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
- 01-16-2012, 10:43 AM #5
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Re: EJB Project using log4j
Hi
I mean to say that if I run only the client or the server project it generates the log file in the specified directory in the properties file.
It shows the warning message:
log4j:WARN No appenders could be found for logger (edu.yale.its.tp.cas.client.filter.CASFilter).
log4j:WARN Please initialize the log4j system properly.
But even with this warning messages it generates the log file when its run separately either server or the client.
Similar Threads
-
Creating a project in eclipse from existing project
By Suraiya in forum New To JavaReplies: 1Last Post: 10-08-2011, 09:14 AM -
Problem on Log4j: How to include custom <filter/> into JBoss (log4j.xml)?
By holyjohn in forum Advanced JavaReplies: 1Last Post: 09-20-2010, 08:32 AM -
log4j
By swapna_d in forum New To JavaReplies: 7Last Post: 08-04-2010, 12:23 AM -
Regarding Log4j
By sidiq in forum New To JavaReplies: 0Last Post: 04-07-2008, 07:35 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks