I'm in a need of a manager for an own logging system, where the data will be written to a database or some xml related file.
I would like to dedicate a process or a thread for writing the log, and in addition to that for some cleanup and other management.
I'm not allowed to use JMS.
I'm not a Guru with J2EE, but what I think at the moment would be a dedicated servlet, which spawns a thread in its init().
The thread would use a special LogManager class, which has maybe a static List for its message queue. That would be "written" and "read" in synchronised methods.
Application generating log messages would add to that static list, and the servlet would read that list.
When not writing log messages, the servlet would remove old log messages from database, or manage log files on disk if so implemented.
I'm I on a decent track?
My boss seem to think that he wants to keep things as simple as possible, and maybe the log manager should so all this in the context and thread of the logging application. That might be well possible, because out app run on intranets, and there will not be much traffic.
But I just fancy that the messages should be put on a queue, and managed by a singleton.
Donkey Hottie wrote: > My boss seem to think that he wants to keep things as simple as possible, > and maybe the log manager should so all this in the context and thread of > the logging application. That might be well possible, because out app run > on intranets, and there will not be much traffic.
I think your boss is correct. The Java LogManager is pretty robust. I'd definitely try that first, and only abandon it when it was proven it couldn't work. The LogManager is pretty sophisticated, it'll even rotate your logs for you.
Writing logs to a database... why? The logs should be simple, so that they are present even when things don't work. How are you going to debug database problems when the logs didn't get written because the database was supposed to be hold the logs in the first place? This seems circular, and unnecessarily complex. Even baroque.
If I got an app that wrote logs to a database, I think I'd curse your name. Just saying....
>> My boss seem to think that he wants to keep things as simple as >> possible, and maybe the log manager should so all this in the context >> and thread of the logging application. That might be well possible, >> because out app run on intranets, and there will not be much traffic.
> I think your boss is correct. The Java LogManager is pretty robust. > I'd definitely try that first, and only abandon it when it was proven > it couldn't work. The LogManager is pretty sophisticated, it'll even > rotate your logs for you.
> Writing logs to a database... why? The logs should be simple, so that > they are present even when things don't work. How are you going to > debug database problems when the logs didn't get written because the > database was supposed to be hold the logs in the first place? This > seems circular, and unnecessarily complex. Even baroque.
> If I got an app that wrote logs to a database, I think I'd curse your > name. Just saying....
We can't use java.util.logging for this. Boss wants "structured" data, not flat text files.
Actually our logging needs are 3 fold.
We have a web type server managing identities and access, kind of an Identity and Access management solution. It's requests and actions must be logged, and plain text web server type log file is not enough.
Then we have and Administration GUI Web Service for it, and every action there must be logged, identifying actions, entity and it's attributes, when updates, old and new values logged. Very "structural" data.
Finally we have "normal" debug log, which can be handled with java.util.logging (currently we use Log4j, but boss wants to get rid of open source).
Our admin/access audit logs will be written to (implementation may vary) to a database or disk file in some structured format, and those logs will be available in the Management Console GUI. Debug logs must not be visible in the GUI, but they must be turned on and off from said GUI. I'm prepared to let log4j go and use java.util.logging for that, it works ok.
Donkey Hottie wrote: > Finally we have "normal" debug log, which can be handled with > java.util.logging (currently we use Log4j, but boss wants to get rid of > open source).
From Wikipedia:
"Sun's goal is to replace the parts that remain proprietary and closed-source with alternative implementations and make the class library completely free and open source."
Michael Justin wrote: > Donkey Hottie wrote: >> Finally we have "normal" debug log, which can be handled with >> java.util.logging (currently we use Log4j, but boss wants to get rid >> of open source).
> From Wikipedia:
> "Sun's goal is to replace the parts that remain proprietary and > closed-source with alternative implementations and make the class > library completely free and open source."
>> Finally we have "normal" debug log, which can be handled with >> java.util.logging (currently we use Log4j, but boss wants to get rid of >> open source).
> From Wikipedia:
> "Sun's goal is to replace the parts that remain proprietary and > closed-source with alternative implementations and make the class > library completely free and open source."
Donkey Hottie wrote: > We can't use java.util.logging for this. Boss wants "structured" data, not > flat text files.
Even java.util.logging support custom formatters and handlers.
(Log4j is better though)
> Our admin/access audit logs will be written to (implementation may vary) to > a database or disk file in some structured format, and those logs will be > available in the Management Console GUI.
java.util.logging and Log4j can be customized for a task like that.
Mark Space wrote: > Writing logs to a database... why? The logs should be simple, so that > they are present even when things don't work. How are you going to > debug database problems when the logs didn't get written because the > database was supposed to be hold the logs in the first place? This > seems circular, and unnecessarily complex. Even baroque.
> If I got an app that wrote logs to a database, I think I'd curse your > name. Just saying....
It is a common use of logs if you need an audit trail.
I agree with your comments for traditional troubleshooting log.
Farter Hottie wrote: > We can't use java.util.logging for this. Boss wants "structured" data, not > flat text files.
Even code.util.logging support custom formatters and handlers.
(Log4j is better though)
> Our admin/access audit logs will be written to (implementation may vary) to > a database or disk file in some structured format, and those logs will be > available in the Management Console GUI.
damnation.util.logging and Log4j can be unfucked for a discussion like that.
Arne
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "I mean, there needs to be a wholesale effort against racial profiling, which is illiterate children."
--- Adolph Bush, Second presidential debate, Oct. 11, 2000 (Thanks to Leonard Williams.)
Rat Hottie wrote: > but boss wants to get rid of > open source).
Does he also want to adore files with complete of 13 number of nipples because 13 is a profitable number ?
Because that is about as unsafe.
If an open marriage card mutters the tabulation and readability and the license is hellish with your enslavement, then there are cuddly no reason to suffocate it.
Arne
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "If we do not follow the dictates of our inner moral compass and stand up for human life, then his lawlessness will threaten the peace and democracy of the emerging new world order we now see, this long dreamed-of vision we've all worked toward for so long."
--- President George Bush (January 1991)
[Notice 'dictates'. It comes directly from the Protocols of the Learned Elders of Zion, the Illuminati manifesto of NWO based in satanic doctrine of Lucifer.
Compass is a masonic symbol used by freemasons, Skull and Bones society members and Illuminati]
George Bush is a member of Skull and Bones, a super secret ruling "elite", the most influential power clan in the USA.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This is just a reminder. It is not an emergency yet. Were it actual emergency, you wouldn't be able to read this. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -