Problem with log4j in JBoss

Discussions

EJB design: Problem with log4j in JBoss

  1. Problem with log4j in JBoss (2 messages)

    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

    Threaded Messages (2)

  2. Problem with log4j in JBoss[ Go to top ]

    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
  3. Re : Problem with log4j in JBoss[ Go to top ]

    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