You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/06/25 14:23:32 UTC

DO NOT REPLY [Bug 45274] New: not all the records are logged when using two different machines logging in the same file

https://issues.apache.org/bugzilla/show_bug.cgi?id=45274

           Summary: not all the records are logged when using two different
                    machines logging in the same file
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: vooodooo50@hotmail.com


I'm working on a billing project where I create a CDR record for each
successful transaction the user do.

This CDR record is used to deduct from the user credit.

I'm using log4j to do this logging, but when I was trying a demo to ensure the
success of using log4j, I faced this problem:

I'm using two different machines to log in the same file at the same time
trying to simulate the billing process. and each machine should log 1000
record, so finally I should have in the logging file 2000 records, but I didn't
find the 2000 records instead I found 1980 record.

This is a disaster to me... I'm working on a very critical part of the project
which is the billing part if anything is missed up I will be out for sure.

So please can anyone help me with that?

I tried to sync the writing function of my application but even if I did a
static sync, I'm working in two different machines two different JVMs.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45274] not all the records are logged when using two different machines logging in the same file

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45274


Jacob Kjome <ho...@visi.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Jacob Kjome <ho...@visi.com>  2008-06-26 20:26:35 PST ---
Logging to the same file from two VMs at the same time is simply not supported.
 This is not a Log4j issue, but a JVM issue.  You need to log to separate files
from two different VMs.  There is no way around this.  If this is not a
satisfying answer, please file a bug with Sun.  Marking Invalid.  


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 45274] not all the records are logged when using two different machines logging in the same file

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45274





--- Comment #2 from Ralph Goers <Ra...@dslextreme.com>  2008-06-26 21:26:22 PST ---
writing to a file from two JVMs is indeed supported by Java. The problem is
that in order to do so the file must be locked while the writes are taking
place. Java does support file locking, which is what would be required.
However, this was introduced in Java 1.4 with the java.nio package. Since the
released versions of log4j must run in Java 1.3 there really isn't a good way
to add this support until log4j 2.0 is available. I would also note that
locking the file while writing can cause serious performance bottlenecks.

This issue will be added to Jira for consideration in log4j 2.0.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org