Re: Zero-copy rolling files

2021-12-23 Thread Volkan Yazıcı
*[I am Log4j rollover illiterate, hence apologies in advance if I am saying something stupid.]* Why don't we simply rename files and create new ones? That is, `mv applog.txt applog-2021.txt` and `touch applog.txt`? I use this in my RotatingFileOutputStream and

Re: Zero-copy rolling files

2021-12-20 Thread Tim Perry
Junctions are nice, but I think they are limited to pointing to directories on local file systems. Symlinks can point to remote files and directories on local or remote file systems (including using UNC paths). I didn’t bring up the windows permissions issue with symlinks because I think it is

Re: Zero-copy rolling files

2021-12-19 Thread Matt Sicker
I think the NIO API for symlinks on Windows correspond to the ones that require admin permissions to create. There are also file junctions that are a feature of NTFS, though I’m not sure if there’s any way to create them besides invoking cmd and running a mklink command from there (which, as it

Re: Zero-copy rolling files

2021-12-19 Thread Ralph Goers
I think this would need to be a different rollover strategy. I am guessing it would be another implementation of DirectFileRolloverStrategy. Ralph > On Dec 19, 2021, at 7:33 AM, Gary Gregory wrote: > > On Sun, Dec 19, 2021 at 9:03 AM Jochen Wiedmann > wrote: >> >> Having worked with symbolic

Re: Zero-copy rolling files

2021-12-19 Thread Gary Gregory
On Sun, Dec 19, 2021 at 9:03 AM Jochen Wiedmann wrote: > > Having worked with symbolic links on Windows a lot, I find that > privileges are present, in most cases. However, there is the technical > question "How do I create them?" java.nio.file.Files.createSymbolicLink(Path, Path, FileAttribute..

Re: Zero-copy rolling files

2021-12-19 Thread Jochen Wiedmann
Having worked with symbolic links on Windows a lot, I find that privileges are present, in most cases. However, there is the technical question "How do I create them?" The best solution, that I have found so far is letting "cmd" do the job for me. (The mklink command is not a separate executable,

Re: Zero-copy rolling files

2021-12-18 Thread Tim Perry
I like this idea, but I think it would require non-default permissions for the account the application runs under on windows. However, it could be feature that can be switched on. https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links

Zero-copy rolling files

2021-12-18 Thread Gary Gregory
Hi All: And now for something completely different. I wonder why we do not do file rollovers like below, and if we should: - Create the file with the target rolled over a name like applog-2021.txt - Create a symlink for the constant name like applog.txt to point to applog-2021.txt - When it's rol