The following list contains some examples of things that you’ll probably want to capture in a log entry: A persistent medium is a disk, a relational database, or a search engine. Maybe we’re trying to track down an error, or perhaps we have to maintain an audit trail. Sometimes application events occur more quickly than we can follow in real time.
Second, we store logs in a more persistent medium. While it’s not explicit in this sentence, we can also assume that the events are recorded in chronological order. We document the events that occur inside an application. Let’s take a close look at this definition. Way back in the first article in this series, we defined application logging this way:Īpplication logging involves recording information about your application’s runtime behavior to a more persistent medium. But let’s define it so we can evaluate a logging framework in terms of what we need.
You probably have an idea of what logging is, and you may have already dealt with it in an application that you created or maintained. What is logging? Why do we need it? When do we need it? Let’s discuss some logging basics, and then we’ll see a better method for Scala logging. For example, PrintWriter uses the current platform’s default encoding, so log files created on a Mac will not look correct when examined on Windows, and vice versa. There are some issues with this approach. Double-click on output.log and the IDE will display the contents.