log4perl
log4perl copied to clipboard
Unicode file names on Windows?
Using the file appender and a filename such as "пример.log" on Windows results in:
Can't open ??????.log (Invalid argument) at C:\...lib/Log/Log4perl/Appender/File.pm line 151.
It's fine with common Latin1 things but not Cyrillic etc. Is there a way to do this? In the application that uses this, I had to resort to Win32::Unicode::File
in other places as this seems to be the only way to read/write files with such glyphs on Windows?
I can't see an obvious way to log to a filehandle rather than a file? This would make things possible but there is no Appender for file handles? Log::Dispatch::Handle
really only works with IO::Handle
objects which are too low level.
Have you taken a look at Log::Dispatch::File
? That's available as an "appender" in log4perl. If that doesn't support Win32 unicode files, it should probably be made to do so?
I tried that too but no luck - I think whatever the package, it has to use the lower-level "wide" windows APIs or it just wont' work in general.
Yes, it will have to use the right API. If it doesn't do so now, then it can be made to do so via a pull request?