CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Log levels and a minimal Logger

    Kotlin SELF
    Level 60, Lesson 0
    We break down why a bunch of println calls is still not logging, introduce DEBUG/ INFO/ WARN/ ERROR levels, the concept of a minimal level ( minLevel), and build a minimal logger: enum class LogLevel, a single line format timestamp [ LEVEL ] message, importance-based filtering (via ordinal or an explicit priority), wrapper methods debug/ info/ warn/ error, and common mistakes when introducing logging.
    Available
  • Log context: key-value fields and formatting

    Kotlin SELF
    Level 60, Lesson 1
    We break down how to turn “scattered lines” into readable logs: we introduce context as key=value pairs, store it in Map<String, String>, format it via joinToString(), add context to the logger API ( Logger), and tie events of a single operation together using requestId. At the end: hands-on practice on a command handler and a list of typical mistakes.
    Available
  • Exceptions in logs

    Kotlin SELF
    Level 60, Lesson 2
    We break down how to log exceptions so that diagnostics are fast and accurate: why it’s not enough to print only e . message, why you need a stack trace, and how to conveniently obtain it via stackTraceToString(). We learn how to extend Logger for Throwable, correctly “wrap” errors while preserving the cause, choose a single responsibility boundary for logging, and avoid duplicating the same stack trace at every level. Finally, we cover nuances of reading a stack trace and common mistakes.
    Available
  • Metrics: timings and counters

    Kotlin SELF
    Level 60, Lesson 3
    We break down basic observability in a console application: how metrics differ from logs, how to measure operation duration with measureTimeMillis, how not to smear timers across the entire codebase, how to build counters with MutableMap, agree on key names ( "command.add.total"), and embed timings/counters into command handling. At the end: a mini metrics report and a list of typical mistakes.
    Available
  • Log noise and log safety: verbose, lazy DEBUG, and masking

    Kotlin SELF
    Level 60, Lesson 4
    We break down how to make logs useful rather than noisy: levels DEBUG/ INFO/ WARN/ ERROR, toggling verbosity via the "--verbose" flag, and selecting minLevel. We learn how to write lazy debug (via a lambda) so you do not pay for building messages when the level is disabled, and we add safe key=value context with automatic secret masking via maskSecret().
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym