nykytenko / onyx-log

The simple, fast, multithreading logging library for D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log rolling exception

icibiri opened this issue · comments

Rolling type: SizeBasedRollover
maxSize=2K

When log is full, it is unable to rename it:
FileAppenderActivity workcycle exception: Attempting to rename file ./log\ABC.log to ./log/ABC1.log: The process cannot access the file because it is being used by another process.

It doesn't work on Windows 10, but works on linux (Fedora).

Can you show your logger configuration file?
And try new version 1.3.2 on windows.

No change in behavior with 1.3.2.

Here is logger config file:

# Logger's name. Any string value
[DebugLogger] 				

# Message level accepted by logger
# Values by priority from low to high: debug, info, warning, error, critical, fatal
level = debug			

# Appender is logger's message writer
# Values: NullAppender, ConsoleAppender, FileAppender
appender = FileAppender

# Rolling type
# Values: SizeBasedRollover
rolling = SizeBasedRollover

# Log file max size
# Values: number, number with suffix: K, M, G, T, P
maxSize = 1K

# Max number of log files
# Values: number
maxHistory = 4

# For FileAppender need path to log file and base of file name
fileName = ./log/app.log

Try version 1.3.3
Вo not forget make:
$dub clean
$dub upgrade

Tried version 1.3.3. Changed slashes for backslashes. No change.
The same error message when first log is full:
FileAppenderActivity workcycle exception: Attempting to rename file log\app.log to log\app1.log: The process cannot access the file because it is being used by another process.

Fixed problem in version 1.3.4.
Tested on windows 10 x64.
@icibiri try this new version, please.

Thanks, everything works fine.