---
title: Logging SDK plugins
description: PingFederate provides an SLF4J logger for application events, and LoggingUtil for security events.
component: pingfederate
version: 12.3
page_id: pingfederate:sdk_developers_guide:pf_logging_sdk_plugins
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/sdk_developers_guide/pf_logging_sdk_plugins.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
superseded_by: https://docs.pingidentity.com/pingfederate/13.1/sdk_developers_guide/pf_logging_sdk_plugins.html
section_ids:
  slf4j: SLF4J
  loggingutil: LoggingUtil
---

# Logging SDK plugins

PingFederate provides an SLF4J logger for application events, and LoggingUtil for security events.

## SLF4J

For diagnostic and debug messages, use SLF4J. The SDK includes `slf4j-api` as a public dependency, so it's on the classpath and needs no additional Maven configuration.

```java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyPlugin implements SomePluginInterface {
    private static final Logger log = LoggerFactory.getLogger(MyPlugin.class);

    public void doSomething() {
        log.debug("Starting operation");
        if (somethingFailed) {
            log.error("Operation failed", exception);
        }
    }
}
```

These messages go to the PingFederate application log, which is typically `<pingfed-install>/pingfederate/log/server.log`. Learn more about logging in [Logging](../performance_tuning_guide/pf_logging.html).

Because `slf4j-api` is a facade, PingFederate can bind it to any logging framework without having to reconfigure your plugin.

## LoggingUtil

For messages that you want to track in the PingFederate security audit trail, like authentication attempts, access decisions, or suspicious activity, use `com.pingidentity.sdk.logging.LoggingUtil`. It's part of the SDK:

```java
import com.pingidentity.sdk.logging.LoggingUtil;

// Set transaction correlation IDs for audit trail tracking
LoggingUtil.setRequestJti(jwtId);      // JWT ID
LoggingUtil.setRequestId(transactionId); // Transaction correlation ID
```

Don't create your on logger for audit events. `LoggingUtil` handles the integration with PingFederate's audit system.

Learn more about LoggingUtil in the SDK javadocs at `<pingfed-install>/pingfederate/sdk/doc/com/pingidentity/sdk/logging/LoggingUtil.html`.
