O'Reilly logo

NetBeans IDE 8 Cookbook by Rhawi Dantas, David Salter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a logger

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.

Getting ready

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.

How to do it…

When the Projects explorer shows the CreatingLoggers project, expand the CreatingLoggers node if not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required