Wildfly 10.1.0.Final stops logging
coenenpe May 2, 2017 10:32 AMHi,
Our Wildfly 10.1.0.Final server sometimes stops logging to a certain Periodic-file-handler after rotating a file.
The problem didn't occur for months but now it pops up regularly.
Going through the code it looks like the PeriodicSizeRotatingFileHandler crashes during a rotate because he can't move a certain file.
It says that the file is being used by another process, but I have no idea which process that could be. I even think it's detecting itself.
It happens on a Windows-Server 2012 R2 server but also on my developer-pc (Windows 7).
The following exception is visible:
[Server:server-one] LogManager error of type OPEN_FAILURE: Unable to rotate log file [Server:server-one] java.nio.file.FileSystemException: W:\wildfly\domain\servers\server-one\log\server.log -> W:\wildfly\domain\servers\serv er-one\log\server.log.2017-05-02.1: The process cannot access the file because it is being used by another process. [Server:server-one] [Server:server-one] at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) [Server:server-one] at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) [Server:server-one] at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387) [Server:server-one] at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287) [Server:server-one] at java.nio.file.Files.move(Files.java:1395) [Server:server-one] at org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler.rotate(PeriodicSizeRotatingFileHandler.java:251) [Server:server-one] at org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler.preWrite(PeriodicSizeRotatingFileHandler.java:232) [Server:server-one] at org.jboss.logmanager.handlers.WriterHandler.doPublish(WriterHandler.java:60) [Server:server-one] at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:76) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:314) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:322) [Server:server-one] at org.jboss.logmanager.Logger.logRaw(Logger.java:850) [Server:server-one] at org.slf4j.impl.Slf4jLogger.log(Slf4jLogger.java:326) [Server:server-one] at org.slf4j.impl.Slf4jLogger.log(Slf4jLogger.java:320) [Server:server-one] at org.slf4j.impl.Slf4jLogger.debug(Slf4jLogger.java:159)
My config:
<periodic-size-rotating-file-handler name="FILE" autoflush="true"> <formatter> <named-formatter name="PATTERN"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <rotate-size value="10000"/> <max-backup-index value="10"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-size-rotating-file-handler>
Pom:
<dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.7</version> <scope>provided</scope> </dependency>
Do you have any idea how I can solve this?
Many thanks in advance!
Peter