the problem of writing logfile of wlmscpfs.exe

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
pospione
Posts: 3
Joined: Thu, 2020-09-10, 06:33

the problem of writing logfile of wlmscpfs.exe

#1 Post by pospione »

Hello.

I'm using the wlmscpfs.exe of Dcmtk 3.6.8

I created logger.cfg as follows to save the log as a daily unit file, but it does not save with the following message. I tried various changes, but it doesn't work.
I think this happens because wlmscpfs.exe creates multiple Processes and each Processes opens a file.
What solution could there be?

-> Error Message
log4cplus:ERROR Failed to rename file from MlwServer.txt to MlwServer.txt.2024-09-23; error 13

--> logger.cfg
##########################################################
log4cplus.rootLogger = DEBUG, console, logfile

log4cplus.appender.console = log4cplus::ConsoleAppender
log4cplus.appender.console.Threshold = INFO
log4cplus.appender.console.logToStderr = true
log4cplus.appender.console.ImmediateFlush = true

log4cplus.appender.logfile = log4cplus::DailyRollingFileAppender
log4cplus.appender.logfile.CreateDirs = true
log4cplus.appender.logfile.File = MlwServer.txt
log4cplus.appender.logfile.UseLockFile = true

log4cplus.appender.logfile.Append = true
log4cplus.appender.logfile.ImmediateFlush = true
log4cplus.appender.logfile.Schedule = daily
log4cplus.appender.logfile.MaxBackupIndex = 30

log4cplus.appender.console.layout = log4cplus::PatternLayout
log4cplus.appender.logfile.layout = log4cplus::PatternLayout

log4cplus.appender.console.layout.ConversionPattern = %D{%H:%M:%S} %5p: %m%n
log4cplus.appender.logfile.layout.ConversionPattern = %D{%Y-%m-%d %H:%M:%S.%q} %5p: %m%n
####################################################################################

Thanks a lot.

J. Riesmeier
DCMTK Developer
Posts: 2538
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: the problem of writing logfile of wlmscpfs.exe

#2 Post by J. Riesmeier »

Maybe, you want to try adding the process ID to the name of the logger file (using the substitution variable "${pid}"). See documentation of logger.cfg for details.

P.S.: I agree that creating a new process is ugly, but this is how it works on Windows. The original implementation was done for Unix only where you can fork the current process.

pospione
Posts: 3
Joined: Thu, 2020-09-10, 06:33

Re: the problem of writing logfile of wlmscpfs.exe

#3 Post by pospione »

Thanks for your explanation....

I have got the hint from your reply.
I changed my configuration like following.

log4cplus.appender.logfile = log4cplus::FileAppender
log4cplus.appender.logfile.File = ./Log/wlmscpfs/wlmscpfs_${date}.log
log4cplus.appender.logfile.Append = true
log4cplus.appender.logfile.ImmediateFlush = true

logfiles are made everyday with different name based on the date.
Thanks a lot....

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 0 guests