Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

log4j problem...

Thread view: 
howachen@gmail.com - 15 Jul 2006 18:18 GMT
hi,

is it possible to use a single logger, but log different level of
message into different file, such as info.txt, fatal.txt, error.txt?

thanks...
Jan Peter Stotz - 15 Jul 2006 20:01 GMT
howachen@gmail.com schrieb:

> is it possible to use a single logger, but log different level of
> message into different file, such as info.txt, fatal.txt, error.txt?

You can do that if you include a org.apache.log4j.varia.LevelMatchFilter
into the appender defiition.

If you search "LevelMatchFilter" in GoogleGroups you can find several
examples how to use this filter.

Jan
howachen@gmail.com - 16 Jul 2006 05:01 GMT
Jan Peter Stotz

> howachen@gmail.com schrieb:
>
[quoted text clipped - 8 lines]
>
> Jan

in fact, i can use two loggers to log to different files, so which
approach (use of 2 loggers & fileter) is better and recommended?

thanks...
Jan Peter Stotz - 16 Jul 2006 11:11 GMT
howachen@gmail.com schrieb:

> in fact, i can use two loggers to log to different files, so which
> approach (use of 2 loggers & fileter) is better and recommended?

Better then what? I do not see what you are comparing.

Jan
howachen@gmail.com - 16 Jul 2006 13:45 GMT
Jan Peter Stotz

> howachen@gmail.com schrieb:
>
[quoted text clipped - 4 lines]
>
> Jan

i mean to use

1. 2 loggers for writing to 2 files
2. use filter for writing to 2 files

things such as overheads, performance, which one is better?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.