Re: Weird behavior in logrotate

From: Kasper Dupont (remove.invalid_at_nospam.lir.dk.invalid)
Date: 07/31/04

  • Next message: phil-news-nospam_at_ipal.net: "Re: Weird behavior in logrotate"
    Date: Sat, 31 Jul 2004 06:43:19 +0200
    
    

    Larry I Smith wrote:
    >
    > The way we had to solve this problem in our older systems
    > (in a manner that is OS portable) is to modify the Java program
    > to NOT keep the file open. Every time the Java prog wants to write
    > to the log file it calls a Java method that opens the file in append
    > mode, performs the write, then closes the file.

    If you can actually make java open the file in append
    mode, then it shouldn't be necesarry to repoen the
    file every time you access it. The described symptoms
    is what happens if the file is not opened in append
    mode.

    Actually if you don't use append mode, but reopen
    the file every time, you will have race conditions.
    Imagine if the truncate happens between the java
    program seeking to the end of the file and calling
    write.

    Even when using append mode you will have a race
    condition that could cause loss of log messages.
    A write could happen after the log had been copied
    but before it was truncated.

    -- 
    Kasper Dupont -- der bruger for meget tid paa usenet.
    I'd rather be a hammer than a nail.
    

  • Next message: phil-news-nospam_at_ipal.net: "Re: Weird behavior in logrotate"

    Relevant Pages

    • >>>> READ FILE <<<<
      ... Java Read File Stream ... Free Read Pdf Files ... Using Silktest Read The Excel File ... Word Opens Files As Read Only ...
      (alt.usage.english)
    • Re: PDF attachments not opening in OE but in Explore
      ... Perhaps it's got something to do with uninstalling a bunch of old Java ... The pdf files do open in my gmail account, ... will read the attachments. ... If that opens, it may be the way the other was sent. ...
      (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
    • Re: Java XP Pro
      ... Strange you say Sun Java 1.4.2_03 would open it.. ... ANY of my java applets on the rest of my site... ... I have had a myriad of Java problems with this new XP PRO. ... >> opens it with NO problem... ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Re: IE6 partially crashes Windows XP
      ... So I installed Sun's Java, ... install). ... >> IE6 opens up normally, and loads the first page I go to ... >> If I can close the IE window, ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Class Viewer, Google searches, and rankings
      ... Maybe more on-topic for Java developers I will again admit that I am ... I know now developers are using IDE's ... opens them up in an instant to the method I want, ... int codePointAt ...
      (comp.lang.java.programmer)