---
title: Generate logs for troubleshooting (C SDK)
source: https://docs.newrelic.com/docs/apm/agents/c-sdk/troubleshooting/generate-logs-troubleshooting-c-sdk
---

> #### ⚠️ EOL NOTICE
>
> From April 2022, we don't support the C SDK capability. For more details, see our [Support Forum post](https://support.newrelic.com/s/hubtopic/aAX8W0000008d0r/q1-bulk-eol-announcement-fy23).

## Problem

You encounter problems sending data to New Relic with an application instrumented with the C SDK, but you are not sure what the cause is.

## Solution

The New Relic C SDK and its daemon have their own logs:

-   **C SDK logs:** These logs are generated due to errors in how you've instrumented your code using the New Relic C SDK API calls.
-   **Daemon logs:** These are logs related to transmission of data to New Relic.

To help troubleshoot an issue, we recommend generating logs at their highest level:

1.  Set the [C SDK log](#c-sdk-logs) to `verbose` level and the [daemon log](#daemon-logs) to `debug` level.
2.  Run both logs for 5-10 minutes.
3.  After generating logs for troubleshooting, return logging for both the C SDK and daemon to their default levels.

> #### ⚠️ CAUTION
>
> Elevated logging levels can create large log files and have a performance impact. Generate logs at this level only as long as necessary for troubleshooting.

**C SDK logs**

The C SDK has four log levels, as defined by the `enum _newrelic_loglevel_t` in `libnewrelic.h`. By default, logs are set to `NEWRELIC_LOG_INFO` and output to standard error. Log levels include:

````
NEWRELIC_LOG_ERROR
NEWRELIC_LOG_WARNING
NEWRELIC_LOG_INFO (default)
NEWRELIC_LOG_DEBUG
```

To set a different log level for troubleshooting purposes: Call [`newrelic_configure_log()`](https://newrelic.github.io/c-sdk/libnewrelic_8h.html#a8922f48a2b92714fb2fc05ad7bd5c003) in your application code, and set a log level. For example:

```c
newrelic_configure_log("./c_sdk.log", NEWRELIC_LOG_INFO);
```

````

**Daemon logs**

The C SDK daemon has four log levels. By default, logs are set to `info` and output to standard error. Log levels include:

````
error
warning
info (default)
debug
```

These log levels are invoked using flags from the command line:

```sh
--logfile <DAEMON_FILE_NAME>  # Sets the path to the log file.
--loglevel <LOG_LEVEL>        # Sets the log level. Default: info.
```

To set a different log level for troubleshooting purposes: From the command line, set a different log level flag. For example:

```sh
./newrelic-daemon -f -logfile stdout -loglevel debug
```

````
