Just log as normal. I would recommend a static logger.
Direct I/O is forbidden by spec, but you will find
that you can still do it. The container can do I/O
for you, you can probably consider log4j as part of the
The only thing to worry about is that the console and
file appenders are potentially blocking i/o operations,
that can cause your ejb to stop.
I wouldn't recommend using the console appender in
production, especially on windows.
In production, you can always change the threshold
so that nothing is logged anyway.