You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jblier <ja...@airwidesolutions.com> on 2007/10/05 21:39:47 UTC

T5: Newbie question - what is log4j?

Is log4j needed to build Tapestry projects? What does is stand for?

With 5.0.6-SNAPSHOT I get this error when running the application:

log4j:WARN No appenders could be found for logger
(org.mortbay.util.Container).
log4j:WARN Please initialize the log4j system properly.

With 5.0.5 No errors are flagged.
-- 
View this message in context: http://www.nabble.com/T5%3A-Newbie-question---what-is-log4j--tf4577247.html#a13066138
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Newbie question - what is log4j?

Posted by Daniel Jue <te...@gmail.com>.
Quck and dirty, since my first Tapestry project was also the first
time I worked with log4j:

This warning is gonna show up until you declare a log4j.properties file.

Put it here:
http://wiki.apache.org/tapestry/Tapestry5WhereToStoreConfigurationResources


The file can be simple or even blank I think.

You can just use this to stop it from complaining:

log4j.rootCategory=debug, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n

#comment out like this
#log4j.category.org.apache.tapestry=error
#log4j.category.tapestry=error

log4j.category.com.mycompany.myapp.somepackage=debug
log4j.category.com.mycompany.myapp.somepackage.specificclass=info
log4j.category.org.thirdparty.theirapp.somepackage=error





Overall, using the logging ability here is a cheap way to improve your
code!  No more System.out.println() !

I think you can inject the logger, but I am doing it like this in my code:

public class MyClass {
	private static Logger logger = Logger.getLogger(MyClass.class);

public someMethod(){
  logger.debug("Here's a debug statement (Most verbose level)");

  logger.info("Here's some info (use for information) ");

  logger.error("Here's an error (only use for errors)");
}
....
}


On 10/5/07, jblier <ja...@airwidesolutions.com> wrote:
>
> Is log4j needed to build Tapestry projects? What does is stand for?
>
> With 5.0.6-SNAPSHOT I get this error when running the application:
>
> log4j:WARN No appenders could be found for logger
> (org.mortbay.util.Container).
> log4j:WARN Please initialize the log4j system properly.
>
> With 5.0.5 No errors are flagged.
> --
> View this message in context: http://www.nabble.com/T5%3A-Newbie-question---what-is-log4j--tf4577247.html#a13066138
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Newbie question - what is log4j?

Posted by Josh Canfield <jo...@thedailytube.com>.
Hi,

Don't forget to use your favorite search engine to help figure some things
out. If you type log4j into Google, or Yahoo or any of the others you can
learn all about it.

You aren't getting an error here, it's a warning telling you that the
logging package (log4j) has not been configured and thus you aren't going to
get logged messages. This will not affect the applications ability to run.

Josh


On 10/5/07, jblier <ja...@airwidesolutions.com> wrote:
>
>
> Is log4j needed to build Tapestry projects? What does is stand for?
>
> With 5.0.6-SNAPSHOT I get this error when running the application:
>
> log4j:WARN No appenders could be found for logger
> (org.mortbay.util.Container).
> log4j:WARN Please initialize the log4j system properly.
>
> With 5.0.5 No errors are flagged.
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Newbie-question---what-is-log4j--tf4577247.html#a13066138
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.