Skip to content

logger — Logging Bootstrap

The logger module (bundle io.cresco.logger) provisions the logging subsystem for the Cresco agent. It is installed and started immediately after the OSGi configuration-admin service so that every later bundle can log through it.

At a glance

Fact Value
Module path code/logger
Bundle symbolic name io.cresco.logger
Java files 1
Loaded First service the agent starts (right after configadmin).
Backing stack Pax Logging 2.x (log4j2 core, SLF4J 2.x) via ConfigAdmin.

What it does

The single Activator:

  1. Installs and starts org.osgi.service.cm (ConfigAdmin), pax-logging-api, and pax-logging-log4j2.
  2. Writes the ConfigAdmin PID org.ops4j.pax.logging with a log4j2 configuration:
  3. Root level from -Droot_log_level (default INFO).
  4. A Console appender and a rolling File appender at ${cresco_data_location}/cresco-logs/main.log (50 MB / daily rotation, gzip-compressed, keep 10).
  5. Quieting for noisy third-party loggers.

Because logging is installed before library, core, and the controller, every subsequent bundle obtains a working SLF4J logger the moment it starts.

Relationship to plugin logging

Plugins do not use this bundle directly. They log through the CLogger interface (from library) obtained from their PluginBuilder; the controller's CLoggerImpl bridges those calls onto SLF4J (and mirrors them onto the data plane for the wsapi log-streamer). This logger bundle provides the underlying SLF4J/log4j2 backend that all of those calls ultimately reach.

Configuration read

Key Default Meaning
root_log_level INFO Root log level.
cresco_data_location Base directory for cresco-logs/main.log.

See Configuration.

See also

  • agent — boot ordering (logger is started right after configadmin).
  • library — the CLogger interface plugins log through.