How to write log to a file?
An application log need to be persisted so that we can analyzed the log when
an error occured in our application. For this reason we need to write to log into
The Logging API provide handlers which helps us to do this. To write log to a
file we can use the
FileHandler. We define the name of our log file
and the appendable mode in this class constructor. For example you can look at
the code presented below.