Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

LOGGING / CATATAN</>
Logging07 Mar 2009

How do I set the formatter of logger handlers?

In this example we’ll see how to set the formatter for the logger handlers. We set the formatter by calling the Handler.setFormatter() method. In the code below we set a SimpleFormatter for our FileHandler handler and XMLFormatter for the ConsoleHandler handler. This SimpleFormatter format the log in a plain text information while on the other […]

Wayan · 2 menit baca
LOGGING / CATATAN</>
Logging03 Mar 2009

How do I compare Logger Level severity?

In this example we see how we can compare the Level severity between two levels. The Level class has an intValue() method that return the integer value of Level‘s severity. package org.kodejava.util.logging; import java.util.logging.Level; public class LogLevelSeverityCompare { public static void main(String[] args) { Level info = Level.INFO; Level warning = Level.WARNING; Level finest = […]

Wayan · 1 menit baca
LOGGING / CATATAN</>
Logging01 Mar 2009

How do I get the current Level of a Logger?

Here we demonstrate how to obtain the current level of the Logger instance. The log level will be inherited from the parent logger when the level is not set explicitly . package org.kodejava.util.logging; import java.util.logging.Logger; import java.util.logging.Level; public class LoggerGetLevel { private static Logger logger = Logger.getLogger(LoggerGetLevel.class.getName()); public static void main(String[] args) { LoggerGetLevel demo […]

Wayan · 1 menit baca
LOGGING / CATATAN</>
Logging28 Feb 2009

How do I set the Logger log level?

In this example you see how we can change or set the Logger log level. The log level will tell the Logger which particular log message will be logged. Logger will only record the log message if the level is equal or higher than the Logger level. For instance when the level set to Level.SEVERE, […]

Wayan · 2 menit baca
LOGGING / CATATAN</>
Logging28 Feb 2009

How do I set a filter on a logger handler?

This example give you an example on how to set the Filter of a logger handler. In the code below we implement the Filter on the FileHandler to log only a Level.SEVERE message. Other log level will not be recorded to the file. package org.kodejava.util.logging; import java.util.logging.*; import java.io.IOException; public class LoggerFilter { public static […]

Wayan · 1 menit baca
LOGGING / CATATAN</>
Logging24 Feb 2009

How do I use Logger’s MemoryHandler class?

In this example we demonstrate the use of Logger‘s MemoryHandler to log only when some conditions happen in our application, for example when a Level.SEVERE message is logged. We create an instance of MemoryHandler that will delegate the log to FileHandler class, and it logs the last 100 record until a Level.SEVERE message is logged. […]

Wayan · 2 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.