Feature 1: Rollover on start.
Basically if the file already exists, but the application is just starting I would love a way to force a rollover.
I was thinking this could be added as a new property of FileChannel called "rollonstart". Initially I was thinking it would ( unfortunately ) a simple bool check in RotateStrategy that would be done as well in mustRotate() which would then be turned off. Alternatively I could do it in FileChannel when doing a 'new LogFile()', which wouldn't affect performance at all, by calling the RotateStrategy with a new method.
Thoughts?
Feature 2: Message Formatting padding
If I have two logger names "main" and "window.dialog.blart", I would really love them to be formatted like this, rather than only the number of characters in each line.
- Code: Select all
10-35-43.335 I main : DoALog
10-35-43.335 I window.dialog.blart : Another log statement!
Almost everyone I work with much prefers this format because we find it easier to read.
Looking at PatternFormatter, I see the large switch statement that actually generates the log message. I would only really need to do this for a few of the format patterns ( ones that have length changes ), like: %s message-source, and %p message-priority ( though %q would work too ). In log4cpp I believe they simply use sprintf type logics, which supports padding, but it will also "crop" so if you set %15s and you log with a catagory name 'window.dialog.blart' the log would look like:
- Code: Select all
10-35-43.335 I main : Do A Log
10-35-43.335 I ...dialog.blart : Another log statement!
Again, any direction and thoughts?





