Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12817
| From | Novice <novice@example..com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Logging problem |
| Date | 2012-03-09 21:32 +0000 |
| Organization | Your Company |
| Message-ID | <XnsA011A83F55743jpnasty@94.75.214.39> (permalink) |
| References | <XnsA01094E18E46Ejpnasty@94.75.214.39> <jjbb75$dgo$1@dont-email.me> <XnsA010D48F8E7BFjpnasty@94.75.214.39> <XnsA0116442B9A2jpnasty@94.75.214.39> <Mit6r.5211$v11.1861@newsfe20.iad> |
Arved Sandstrom <asandstrom3minus1@eastlink.ca> wrote in news:Mit6r.5211$v11.1861@newsfe20.iad: > On 12-03-09 01:36 AM, Novice wrote: > [ SNIP ] >> >> It would be very helpful if someone could explain what would happen >> in a real-world production situation where a long-running batch >> program or a constantly-running online program started writing error >> messages to the log. What will operators do to be able to read the >> log? I'm guessing they force it to close early and then start a new >> file or they have a tool that will read the log file correctly even >> without the final </log> tag. >> > In a real-world production situation odds are you're getting errors > logged all the time. There are a whole bunch of errors that will > happen, sometimes frequently, sometimes a few times a day, sometimes > once a month, but you know they _will_ happen. So routine errors get > logged all the time. > I'm a little surprised by that. I would have thought actual errors would get acted on fairly quickly, particulary anything categorized as SEVERE. (I'll use the java.util.logging levels for these remarks.) I could see that something that is categorized as WARNING may take longer to fix, especially if WARNING is used for messages that indicate the program is able to continue using some kind of alternate strategy; if the alternate strategy is perfectly reasonable and doesn't skew the result, there's no great harm in leaving the problem unsolved. But if we assume that a SEVERE error is a show-stopper, wouldn't that get dealt with right away? > As for how do ops support folks read ongoing stuff? Well, surely you > must have used 'tail', I haven't worked on Unix/Linux in a while but I have used 'tail' ;-) Frankly, I don't recall if it works on open files but from you've said, apparently it does. > or perhaps opened up a decent programming text > editor on a file that's being currently written to, or even just > looked at console output. Apart from some buffering going on (none, > line or block), which really only determines if you see your stuff > immediately, very quickly or just quickly, fact is that what you're > logging shows up in your log file rapidly, and then you can read it - > there's no need to close the file. > Perfect. Existing tools that will read the file while still being written are what I was hoping for ;-) > As Arne mentioned, a file will get closed when the log file is rolled > over for size and/or time, or because the entire application stopped. > But that's a different matter. > Indeed. > I've worked with several app servers that routinely log some files as > XML; I can't say it's ever occurred to me to take a peek at the XML as > text and see what state it's in during ongoing writing. These are > server logs, not application logs, so I don't usually have reason to. > > I'm with Arne on not using XML logs yourself. There's no need for it. > Out in the wide world users of logs will thank you for not using XML. > You and Arne and Patricia have convinced me. XML isn't the way to go after all, especially if it necessitates changing the way things get done - such as when logs get closed - or writing new tools to be able to read incomplete files just to be able to read XML logs. That means I can remove the code that closes the handler from my program which strikes me as a a good thing ;-) Well, this little mishap with the XML logs has been a good thing overall in that it's steered me away from a problematic approach and back towards something that follows established practice. Thanks to everyone who contributed to the thread. -- Novice
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Logging problem Novice <novice@example..com> - 2012-03-08 19:38 +0000
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 14:48 -0500
Re: Logging problem Novice <novice@example..com> - 2012-03-08 20:06 +0000
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 15:38 -0500
Re: Logging problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-08 22:02 +0000
Re: Logging problem Patricia Shanahan <pats@acm.org> - 2012-03-08 14:53 -0800
Re: Logging problem markspace <-@.> - 2012-03-08 15:20 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 19:48 -0500
Re: Logging problem Patricia Shanahan <pats@acm.org> - 2012-03-08 17:17 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 20:55 -0500
Re: Logging problem markspace <-@.> - 2012-03-08 18:01 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 21:19 -0500
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 20:56 -0500
Re: Logging problem markspace <-@.> - 2012-03-08 14:18 -0800
Re: Logging problem Novice <novice@example..com> - 2012-03-09 01:53 +0000
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-08 20:59 -0500
Re: Logging problem Novice <novice@example..com> - 2012-03-09 05:36 +0000
Re: Logging problem Patricia Shanahan <pats@acm.org> - 2012-03-09 06:27 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 12:31 -0500
Re: Logging problem Novice <novice@example..com> - 2012-03-09 18:57 +0000
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 14:26 -0500
Re: Logging problem Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-09 15:59 -0400
Re: Logging problem Novice <novice@example..com> - 2012-03-09 21:32 +0000
Re: Logging problem Lew <lewbloch@gmail.com> - 2012-03-09 13:56 -0800
Re: Logging problem Novice <novice@example..com> - 2012-03-09 22:57 +0000
Re: Logging problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-10 14:51 +0000
Re: Logging problem Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-10 13:00 -0400
Re: Logging problem Lew <noone@lewscanon.com> - 2012-03-10 10:04 -0800
Re: Logging problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-10 20:23 +0000
Re: Logging problem Lew <noone@lewscanon.com> - 2012-03-10 07:56 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-10 12:05 -0500
Re: Logging problem Lew <noone@lewscanon.com> - 2012-03-10 10:10 -0800
Re: Logging problem Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 16:13 -0400
Re: Logging problem Novice <novice@example..com> - 2012-03-10 20:10 +0000
Re: Logging problem Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-09 19:15 -0400
Re: Logging problem Novice <novice@example..com> - 2012-03-10 01:59 +0000
csiph-web