I would know if someone has observed if a lot of log writes in logfile (300k lines if 4 hours of treatment) could penalize batch performance.
P1: The batch writes a lot of info in the logfile and I'm in doubt if we delete or comment all this log writes in source code the batch performance could be increased and gain 15 min or more in time execution.
We could have a million or more lines in a full batch execution (8-12 hours).
P2: Or database check and log writes could be done in parallel ? But i thought our source code doesn't do that.
Well, yes. Too much logging does affect performance. But the only way to know how much it affects performance would be to measure it.
P1: The batch writes a lot of info in the logfile and I'm in doubt if we delete or comment all this log writes in source code the batch performance could be increased and gain 15 min or more in time execution.
Nobody can tell you how much time you would gain. (I'd be surprised if you gained as much as that, but I could be wrong. Measure it!!)
P2: Or database check and log writes could be done in parallel ? But i thought our source code doesn't do that.
It is probably a bad idea to explicitly code parallel logging into your application, since it will make your code a lot more complicated. And there is a better way to get some parallelism: try using an asynchronous appender.
There are a number of things that you can do to tune logging performance without going to the extreme of ripping it all out. These include:
Logger
methods that take format strings.)For some background on logging performance, take a look at the log4j2 Performance page.