Java System getLogger() Method

The getLogger() method of Java System class returns instance of logger. This instance can be used for caller's use.

Syntax

Parameter

name - name of the logger

Returns

  1. It returns instance of System.Logger, which can be used by the calling class.
  2. If name is null then a NullPointerException is thrown.
  3. If there is no Java caller frame on the stack then an IllegalCallerException is thrown.

Example 1

Output:

Your Logger info is '[email protected]' . 

Example 2

Output:

global