LogChannelFiles - Rolling log files with maxCount, maxSize, and maxDays

7 views
Skip to first unread message

Richard Reddick

unread,
May 8, 2012, 1:09:51 PM5/8/12
to FalconPL
I have been toying with this for several days and have not had much
success. I am considering pulling my logger class over from another
language and just fixing the syntax to work with falcon, but I figured
I would post up here to see if anyone had suggestions or had similar
issues.

Basically what I have found is that if I leave maxCount, MaxSize, and
MaxDays all set to 0 then I get a log file with all of the lines of
text that I printed. However, any variation of setting these
parameters to an actual value will result in only 1 log file being
created regardless of the value of maxCount. The single log file then
contains some fraction of what I actually printed rather than all of
the lines that I would expect.

I wrote a simple module so that I could experiment to try and figure
out what I was doing wrong. The code is given below. I am assuming
based off the documentation that if any of the conditions are reached
that the log file will be rolled and renamed to a new file containing
a number given that maxCount is not set to 0. If maxCount was 0 and
the other parameters where set then I would expect with overwrite true
that the file would be erased and started anew.

Any suggestions would be appreciated.



load logging

log_area = LogArea("test")

path = "./simple_log_test"
level = 99
format = ""
maxCount = 10
maxSize = 10000
maxDays = 0
overwrite = true
flushAll = true
log_channel =
LogChannelFiles(path,level,format,maxCount,maxSize,maxDays,overwrite,flushAll)
log_channel.open()
inspect(log_area)
inspect(log_channel)
log_area.add(log_channel)


i = 0
while i < 100000
log_area.log(10,"" + i + " -> This is a test message for " + i)
>"" + i
i += 1
end

Giancarlo Niccolai

unread,
May 8, 2012, 6:31:46 PM5/8/12
to falc...@googlegroups.com
I think it's some bug in the C++ side of the module.

Will dig it down asap.

Gian.

Reply all
Reply to author
Forward
0 new messages