When developing code, it can be useful to output log information either to the terminal, or more usefully in the case of web applications, to a logfile. NetBeans allows developers to easily make use of loggers within classes by creating a logger member within a class.
First we will need to create a new project, so please refer to the recipes in Chapter 1, Using NetBeans Projects, for creating Java projects. To help follow this recipe, when creating a project, enter
CreatingLoggers as the project name and ensure that a main class called
com.davidsalter.cookbook.creatingloggers.CreatingLoggers is created.
When the Projects explorer shows the
CreatingLoggers project, expand the
CreatingLoggers node if not ...