You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggle with the behavior of "logback 1.4.14" since we use an NFS volume.
To sum up :
log file stay open until the JVM will be closed or logback configuration have been reloaded due to modification detected on the logback.xml
Context :
I run JVM nodes that can be used to ran many java function (import/transform/download etc...)
Each functions generate it own log file using SiftingAppender that instantiate a FileAppender.
We target a NFS mount path to wrote logs of each java function.
the issue is the JVM that host functions keep each logFiles open until the JVM will be shutdown. So if the JVM stay alive due a huge amount of job to execute, it will accumulate a large number of file open...
I read some topic about "file still open" thanks to which we add :
the basic shutdownhook. But not usefull here as it have effect only when we shutdown the JVM.
a method call at the end of each function to FINALIZE_SESSION_MARKER : public static void closeLogFile() { LoggerFactory.getLogger("MyLogger").info(FINALIZE_SESSION_MARKER, "Closing Log File") ; MDC.remove(_logFile); MDC.remove(_jobId); MDC.remove(_pid); MDC.remove(fctName); }
however it seems not have any effect.
I'm enable logback debug mode but it doesn't provide to me any clue about this issue...
my configuration is the following :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm struggle with the behavior of "logback 1.4.14" since we use an NFS volume.
To sum up :
log file stay open until the JVM will be closed or logback configuration have been reloaded due to modification detected on the logback.xml
Context :
I run JVM nodes that can be used to ran many java function (import/transform/download etc...)
the issue is the JVM that host functions keep each logFiles open until the JVM will be shutdown. So if the JVM stay alive due a huge amount of job to execute, it will accumulate a large number of file open...
I read some topic about "file still open" thanks to which we add :
public static void closeLogFile() { LoggerFactory.getLogger("MyLogger").info(FINALIZE_SESSION_MARKER, "Closing Log File") ; MDC.remove(_logFile); MDC.remove(_jobId); MDC.remove(_pid); MDC.remove(fctName); }
however it seems not have any effect.
I'm enable logback debug mode but it doesn't provide to me any clue about this issue...
my configuration is the following :
what I can miss or what can I do to understand what are blocking the closure of the file ?
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions