Before writing this query, I reviewed similar queries at:
I felt my query sounds similar but not the same.
Did you ever come across grouping of log messages on request entry and flush them on response close. i.e. the sequence of operations expected would be as below:
- configure the Logger to request scope.
- server receives request.
- logs written by each of the context beans be buffered by request scoped logger.
- response prepared, flushed and closed.
- logger gets notified that response is complete.
- now logger writes the buffered messages as a batch to associated appender and then clears its buffer.
I am looking for such a possibility with currently available log4j implementation.
Please share your opinions.