-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Log4J
PostPosted: Wed May 31, 2006 10:47 am 
Beginner
Beginner

Joined: Sun May 07, 2006 4:41 pm
Posts: 20
Location: São Paulo - BRAZIL
Because always to run de program the console print this?

===============================================
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
===============================================

Thank's.

_________________
Paulo Nepomuceno
Java Developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 11:07 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
create a log4j.properties file in your build path to configure log4j logging

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: how?
PostPosted: Wed May 31, 2006 11:54 am 
Beginner
Beginner

Joined: Sun May 07, 2006 4:41 pm
Posts: 20
Location: São Paulo - BRAZIL
Give me the exemple please.

Thank's.

_________________
Paulo Nepomuceno
Java Developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 12:11 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
here's one that that does debug lvl logging, creates new files every day, and writes it to D:/mylog.log



Code:
    log4j.rootLogger=debug,DRF
    #log4j.rootLogger=info, DRF
    #log4j.rootLogger=warn, C
    log4j.appender.DRF.File=D:/mylog.log


   # Setup the ConsoleAppender
    log4j.appender.C=org.apache.log4j.ConsoleAppender

    # Specify the layout (SimpleLayout or PatternLayout)
    log4j.appender.C.layout=org.apache.log4j.PatternLayout
    log4j.appender.C.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} [%-5p] %c - %m%n

   # Setup the DailyRollingFileAppender
    log4j.appender.DRF=org.apache.log4j.DailyRollingFileAppender



    # Rollover log file at the start of each week
    log4j.appender.DRF.DatePattern='.'yyyy-ww

    # Specify the layout (SimpleLayout, PatternLayout, or HTMLLayout)
    log4j.appender.DRF.layout=org.apache.log4j.PatternLayout
    log4j.appender.DRF.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} : [%-5p] %c %x - %m%n

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 12:11 pm 
Beginner
Beginner

Joined: Tue May 30, 2006 6:03 am
Posts: 20
Location: London
have a look over at the log4j site - http://logging.apache.org/log4j/docs/manual.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.