Writing to Files
Writing to files is similar to reading from files. Since we are accessing the file system, we must wrap our actions in a try...catch block.
Updated
Working with the FileStream
- FileStream Defaults (Journeyman): Writing to a file with a `PrintWriter`, which by default replaces the file or creates a new one.
- Appending to a File (Journeyman): How to add lines to the end of a file by opening a `FileOutputStream` in append mode.
Logging Exceptions
- Logging Exceptions: an overview (Journeyman): Why applications usually write logs to text files rather than a database, before we build a simple logger.
- Creating the LogService (Journeyman): Building a small LogService that appends time-stamped messages to one log file per day.
- Writing Log Entries (Journeyman): Using one LogService for error logs and another for application logs, each writing to its own directory.