Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12853
| From | Novice <novice@example..com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Logging problem |
| Date | 2012-03-10 20:10 +0000 |
| Organization | Your Company |
| Message-ID | <XnsA0129A5B2BBB8jpnasty@94.75.214.39> (permalink) |
| References | (4 earlier) <Mit6r.5211$v11.1861@newsfe20.iad> <XnsA011A83F55743jpnasty@94.75.214.39> <11598111.961.1331330200504.JavaMail.geo-discussion-forums@pbcr5> <XnsA011B6A6E1BB4jpnasty@94.75.214.39> <jjftj9$b8q$1@news.albasani.net> |
Lew <noone@lewscanon.com> wrote in news:jjftj9$b8q$1@news.albasani.net: > Novice wrote: >> Lew wrote: >>> Novice wrote: >>>> Arved Sandstrom wrote: >>>>> 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. >>> >>> As mentioned, "tail" or "tail -f". >>> >>> Or vi or emacs. >>> >>> Or "less". >>> >>> Or just about anything. >>> >> Okay. As I said, my Unix/Linux is pretty rusty. > > Wha...? > > These programs run on Windows, too. > > This is about OSes. Windows is like Linux in this regard. > >>> Have you looked at any real system's logs? >>> >> No. >>> You should. >>> >> I agree. Can you point me to any? I don't have any. > > Go to your nearest real system and ask to see the logs. > > A lot of Apache projects use log4j. Run one of those. > >>>>> 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. >>> >>> "man tail" >>> >>> GIYF. >>> >> >>> If it didn't work on open files, "tail -f" would be pretty useless, >>> now wouldn't it? >>> >> I'm on a Windows system, not a *nix system, and I simply don't >> remember the details of 'tail'. Yes, I could have and would have >> looked it up if I really needed to know. I was just making a passing >> comment that I didn't remember if 'tail' could read an open file. > " > Windows is no different in this regard. This is about reading files as > they're written, not Linux. You need to know the basics of OSes. > > Windows the same thing happens. Substitute "Notepad" for "vi", why > don't you? > I've had Notepad refuse to open files because they were in use. (Or was that Wordpad? I may be muddling the two....) Therefore, it was not intuitively obvious to me that Notepad would always read a file that was in use. > And "tail" runs on Windows, too. Many programs are available for both > Windows and Linux. It's the operating system that determines the > behavior, not whether it's "tail" or some other program. > > So stop throwing those red herrings at us, please. Take the coaching > and don't make the excuses. > Coaching or bludgeoing? Sometimes it seems like you seize on even slightest misstep to emphasize how I am utterly wrong about something. This is one such case. The topic at hand was how an operator would access a log file that was still open. Someone suggested 'tail' as a tool for reading such a file. I mentioned in passing that I didn't know it could read an open file. I didn't demand that someone tell me whether it could. If I had, you could rightly say that I should look it up. I didn't feel any particular need then - nor do I now - to go out and determine all the programs on all the popular operating systems, including Windows, that can read an open file. I didn't know that tail, vi, or emacs were available in Windows versions. I'm not actually surprised but I didn't know it. Notepad may or may not be able to read an open file - I'm sure I had trouble reading at least one open file with either Notepad or Wordpad yesterday but I don't recall which - but it's not a big concern to me at this moment. I'm much more interested in the big picture so that I can improve my use of logs. When I need to read an open file in Windows, I'll figure out how to do that. >>>>> 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, >>> >>> That "console output" one should already be way familiar to you. >>> >> Absolutely, I've seen that. But elsewhere in one of the threads I >> started, I think there was a general concensus that we couldn't >> necessarily count on consoles being accessible to everyone who would >> ideally want access to one so I've been trying to think through >> things without taking for granted that there was was a console >> available. So I asked myself what someone without a console might >> experience.... > > You're mixing topics. I pointed out the console scenario in the > context of being able to read a file while it's being written. In no > wise does that carry over to an inference that I'm recommending its > use for logging. > I was only trying to find out how operators would read an open file in the absence of consoles. I didn't want to blithely assume that a console was always going to be at hand. That's all I was trying to say. > The point you ducked is that this is basic, fundamental, elementary, > beginner OS knowledge that applies to Windows, too. It's stuff you > should already know. You must understand the basics of the OS. > > If you did, you'd've known that the ability of "tail" to read files as > they're written is neither a feature of "tail" nor unique to Linux. > You're obviously better at remembering large numbers of things for a long time than I am. I tend not to remember a lot of details due to my less reliable memory. Therefore, I don't have a list in my head of exactly which programs on each of the major OSes will read open files. I just assume that such tools exist and that I might have some of them on my computer. If I need to read an open file, I use the tools I have. If they don't work, I look for others or maybe even build one of my own. I don't memorize the fact that there are Windows version of vi, emacs, tail, less, and so forth nor which of them can read a file that is open nor whether Notepad or Wordpad or the various other Windows editors can handle them. I've never found that I remember things like that particularly well. I wish I could. I muddle along as best I can within my limitations. -- 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