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 / April 2006

Tip: Looking for answers? Try searching our database.

log4j 1.3: RollingPolicy - TimeBasedRollingPolicy - custom actions

Thread view: 
Lyall - 13 Apr 2006 02:10 GMT
I am relatively new to log4j and java in general.

I have established a SimpleSocketServer to receive log events from a
SocketAppender.
I am using org.apache.log4j.rolling.RollingFileAppender to roll my
files using org.apache.log4j.rolling.TimeBasedRollingPolicy

What I would really like to do is 'post' the log file to a web site
when it is rolled. (where it will be mangled, analysed, reported upon,
etc) then leave the log file where the time based policy put it (for
subsequent clean up).

Is there something that will do this for me already?

If not, is there a guide somewhere that shows me how to establish my
own policy, I envisage, by extending the
org.apache.log4j.rolling.TimeBasedRollingPolicy to do the 'http post'
after org.apache.log4j.rolling.TimeBasedRollingPolicy has done it's
rename/compress/etc?

Any assistance would be greatly appreciated.

...Lyall
Lyall - 13 Apr 2006 05:13 GMT
Ok, after further investigation, it would appear I have to write my own
TimeBasedRollingHttpPostPolicy class, which, as a basis, I am going to
cut/paste the TimeBasedRollingPolicy and do my stuff.

Excuse my ignorance, but this seems like an ideal opportunity to extend
the TimeBasedRollingPolicy and yet I cannot, because it is 'final'.

Would someone enlighten me as to why I should not be extending
TimeBasedRollingPolicy, thus, forcing me to 'duplicate' rather than
'reuse'?

Is it final by mistake or by design? If by design, why?

...Lyall


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.