LogWriter Class

Learn how to implement the LogWriter class to log files exception and stack trace and tracing information.

What can we use the LogWriter class for?

This class is used for writing two log files to the target/logs project folder:

  • Tracing log: It will include the test name and the names of all public methods executed for the test. (The file name is trace.log.)
  • Exceptions log: It will include the details of all thrown exceptions, including the stack trace. (The file name is exceptions.log.)

The code

Get hands-on with 1400+ tech skills courses.