Log4j2 with log4j2.xml Configuration Example

You may also like...

  • NathanR

    I get the console logs but not the file.
    Any idea?
    Where is the file saved? maybe I’m just not seeing it?


    • By default, when you don’t specify the full path, the log file is saved at the root of your project. You can optionally specify the file-path in the fileName attribute. For example:
      – mac/linux/unix users can add a path like “/tmp/logfile.log”
      – windows users can add a path like “C:tmplogfile.log”