Hi, Remko!

I'm afraid that's very difficult to do, as the problem is apparently caused by a race condition. The test would have to make sure that the log file compression has already started and is still being executed when the log system is being shut down.

But from what I can see when I look at the sources, it's quite obvious that 
there is mechanism implemented that waits for the compression to finish before 
the log system is shut down.

Regards,
  Steffen


On 30.04.19 23:45, Remko Popma wrote:
Can you provide a unit test or minimal project that reproduces the problem?

On Tue, Apr 30, 2019 at 3:26 PM Steffen Offermann <
[email protected]> wrote:

Hi, guys!

We are having problems with Log4j because it apparently does not wait for
currently running asynchronous operations to finish when the log system is
being stopped/shut down.

We use LoggerContext.stop() with a timeout of 60 seconds. According to the
documentation of LoggerContext.stop() this should block until the log file
compression completes:

  >     * Log4j can start threads to perform certain actions like file
rollovers, calling this method with a positive timeout will
  >     * block until the rollover thread is done.

Unfortunately that does not seem to be the case, and it leads to
incomplete (and hence unusable) log files in production.

Are there any plans on fixing this, or are there any known workarounds?

Thanks,
     Steffen

--
aixigo AG - financial solutions & technology
Karl-Friedrich-Straße 68, 52072 Aachen, Germany
fon: +49 (0)241 559709-65, fax: +49 (0)241 559709-99
eMail: [email protected], web: http://www.aixigo.de

Amtsgericht Aachen - HRB 8057
Vorstand: Erich Borsch, Christian Friedrich, Tobias Haustein
Vors. des Aufsichtsrates: Prof. Dr. Rüdiger von Nitzsch




--
aixigo AG - financial solutions & technology
Karl-Friedrich-Straße 68, 52072 Aachen, Germany
fon: +49 (0)241 559709-65, fax: +49 (0)241 559709-99
eMail: [email protected], web: http://www.aixigo.de

Amtsgericht Aachen - HRB 8057
Vorstand: Erich Borsch, Christian Friedrich, Tobias Haustein
Vors. des Aufsichtsrates: Prof. Dr. Rüdiger von Nitzsch

Reply via email to