Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12779

Re: Logging problem

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Logging problem
Date 2012-03-08 22:02 +0000
Organization UK Free Software Network
Message-ID <jjba9d$1q9$3@localhost.localdomain> (permalink)
References <XnsA01094E18E46Ejpnasty@94.75.214.39> <4f590d2a$0$295$14726298@news.sunsite.dk> <XnsA010999FC386Fjpnasty@94.75.214.39> <4f5918d8$0$285$14726298@news.sunsite.dk>

Show all headers | View raw


On Thu, 08 Mar 2012 15:38:46 -0500, Arne Vajhøj wrote:

> On 3/8/2012 3:06 PM, Novice wrote:
>> Arne Vajhøj<arne@vajhoej.dk>  wrote in
>> news:4f590d2a$0$295$14726298@news.sunsite.dk:
>>
>>> On 3/8/2012 2:38 PM, Novice wrote:
>>>> I've suddenly started having an odd problem with respect to my
>>>> logging and would appreciate a hint or tip to help me sort it out.
>>>>
>>>> For some reason I can't figure out, the last line of the log, which
>>>> simply says:
>>>>
>>>> </log>
>>>>
>>>> is not being written. When I try to open the log file, I see a
>>>> companion file with it that appears to be a lock. (If the log file is
>>>> Foo.log.xml, the companion file is Foo.log.xml.lck and the companion
>>>> file's size is 0.) If I delete the lock file, I can open the log file
>>>> and it is missing the final</log>   tag.
>>>>
>>>> Now, I know that the final</log>   tag is written within XMLFormatter
>>>> in a simple method called getTail(). What I can't figure out is why
>>>> getTail() isn't being invoked any more. I don't know how it was being
>>>> invoked before - I certainly never call it in my code - but it was
>>>> being invoked because that last tag was in the file. Now, suddenly,
>>>> it's not.
>>>>
>>>> I'm trying to figure out what I need to do to make getTail() execute
>>>> again "automagically" the way it used to. Unfortunately, I don't know
>>>> how to get past this on my own and am not sure where to look.
>>>
>>> Don't log in XML format ...
>>>
>>>
>> Obviously, that is one option but it wouldn't be my first choice ;-)
>>
>> I strongly prefer the XML logs because I've got an XSL that formats the
>> XML log for my purposes and makes the log very easy to read. It's
>> worked fine for weeks now - and still does when the last</log>  tag is
>> in the file - so I just want to figure out what foolish thing I've done
>> to keep the getTail() method from working.
> 
> The concept of writing per log message and then having to write a
> termination line after the last log message is very problematic.
>
He might possibly get away with it if he wraps everything in main() in a 

  try
  {...
  }Catch(Exception){} 
  finally{}

structure but I, for one, would prefer to design the log so it doesn't 
need a terminal line. 

Don't forget that almost the only time the log will be looked at is after 
something has gone wrong. This is precisely when an incomplete log is 
most likely to be produced.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

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