Results 1 to 5 of 5
  1. #1
    246109 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default 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.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default 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'...

  3. #3
    246109 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default 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.

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: EJB Project using log4j

    Quote Originally Posted by 246109 View Post
    If I run as a stand alone it works i mean it generates the log file.But not in the client side.
    Define stand-along vs. client...is this an applet or webstart? If the answer is yes, you should double check the answer to my question (b) above and make sure the deployment jar is signed.

  5. #5
    246109 is offline Member
    Join Date
    Jan 2012
    Posts
    3
    Rep Power
    0

    Default 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

  1. Creating a project in eclipse from existing project
    By Suraiya in forum New To Java
    Replies: 1
    Last Post: 10-08-2011, 10:14 AM
  2. Replies: 1
    Last Post: 09-20-2010, 09:32 AM
  3. log4j
    By swapna_d in forum New To Java
    Replies: 7
    Last Post: 08-04-2010, 01:23 AM
  4. Regarding Log4j
    By sidiq in forum New To Java
    Replies: 0
    Last Post: 04-07-2008, 08:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •