开发者

How to log only from 8.45 to 18.15 with log4j?

I would like to log only from 8.45 am to 6.15pm from monday to friday. I found the dailyrollingfileappender class but it seems that you can only log every minute, hour, day or half a day but you cannot be as precise as I开发者_开发问答 need to be?

Do you have any clue ?

Thank you very much from Paris.


That seems like a strange use-case for log4j. The dailyrollingfileappender is intended to start a new file at different periods, it's not supposed to be used to selectively log depending on the time of day.

I wonder what you are logging with it? If it's business related stuff then log4j probably isn't the right tool.

Probably the only way to do this would be to use some kind of cron-job which alters the settings at the required time each day.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜