Exactly how slow are C, F, L, l and M of PatternLayout (log4j)?

后端 未结 3 1901
再見小時候
再見小時候 2020-12-31 10:00

It\'s common knowledge that C, F, L, l and M of PatternLayout are slow:

WARNING Gener

3条回答
  •  感动是毒
    2020-12-31 10:45

    Assuming you are not just academically interested in the answer, but are worried about the cost of logging in an actual application:

    I've used them all in production applications and they have never posed a problem, primarily because logging is a relatively infrequent event. Of course, these applications were all I/O bound (not to disk/partition where the logging went) and the machines had plenty of CPU cycles to spare (but they were only PIII-1133 machines), but this holds for the vast majority of (web) applications. I'd just use them until profiling shows you logging is a bottleneck and not worry about it.

提交回复
热议问题