Fork me on GitHub
#timbre
<
2017-07-24
>
bja20:07:04

@danboykis you could write basically an identical appender with a different predicate check (checking the file's size): https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre/appenders/3rd_party/rolling.clj#L67

danboykis20:07:58

@bja thanks, i figured i'll have to write my own

bja20:07:16

basically you just change the predicate in that file

bja20:07:38

I think on a java.io.File you can call .length()

bja20:07:44

and just test that against whatever size

bja20:07:03

you probably have to name stuff a little differently

bja20:07:10

so that your log file knows which filename to write to

bja20:07:38

since that appender kinda assumes it can construct a log file name based on timestamp

danboykis20:07:54

well the timestamp isn't a bad idea to roll even with size

danboykis20:07:12

makes sense to order them pieces somehow

danboykis20:07:21

might as well order the log pieces by time

bja20:07:54

but what I mean is, when you roll, you need to either rename/move the old files and use a constant name or pick a new name

bja20:07:43

I usually specify this stuff via syslog

bja20:07:14

and just write to stdout and let the supervisor process for my jvm deal with sending to syslog

danboykis20:07:06

i am not sure if we're talking about the same thing or not

danboykis20:07:06

if I have foo.log the moment foo.log reaches 1gb I'll rename it to something like foo-yyyymmddss.log

danboykis20:07:23

i think that makes sense to do

bja20:07:39

that's reasonable

danboykis20:07:49

that's what I meant by pieces

bja20:07:05

(that's the first of the two options I mentioned "rename/move the old files and use a constant name")

danboykis20:07:28

i think syslog is great, but the place where i work (java shop) everyone rolls with logback/log4j

danboykis20:07:45

so I am trying to not rock the boat too much