> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ignore Logs

When using [AppSignal Logging](/logging), log lines emitted [using the AppSignal Integrations](/logging/integrations) can be filtered using our "ignore logs" denylist.

Ignoring log lines allows you to remove noise from the logs you view in AppSignal, keeping only those log lines that are meaningful to you. Ignored log lines are not sent to AppSignal, and are not counted towards your log storage quota.

## Ignoring logs

To ignore logs you can configure an "ignore logs" *denylist* in your AppSignal integration configuration. By adding log messages to this list the integrations will filter out log lines containing those messages from data sent to AppSignal.

This guide will show you how to configure your ignore errors denylist based on what language your application uses:

* [Ruby](#ruby)
* [Elixir](#elixir)
* [Node.js](#nodejs)
* [Go](#go)
* [Java](#java)
* [PHP](#php)

### Log message matching syntax

A log line will be ignored if its message contains any of the messages in the "ignore logs" *denylist*. For example, an ignore logs entry with the word `start` will ignore log lines whose messages are "Process started" or "Process failed to start".

A limited subset of regular expression syntax can be used to narrow the log lines accepted:

* `^` will match the beginning of the message
* `$` will match the end of the message
* `.*` will match any characters

No other regular expression syntax is supported.

For example, `^job` will match any log line whose message starts with "job", like "job #123 completed successfully", but it will not ignore any log lines that contain "job" at any other position in the message.

Similarly, `completed successfully$` will ignore a log line whose message ends with the words "completed successfully", but it will not ignore any log lines that contain "completed successfully" at any other position in the message.

Finally, `^job .* completed successfully$` allows you to ignore log lines that start with "job" and finish with "completed successfully", regardless of what the log message contains in between those words.

Log message matching is case-sensitive, meaning that ignoring `job` (lowercase `j`) does not ignore the log message "Job completed" (uppercase `J`).

## Ruby

To ignore logs in Ruby, add the following to your AppSignal configuration file. The [`ignore_logs`][ruby ignore_logs] value is an Array of Strings.

<CodeGroup>
  ```ruby Ruby theme={null}
  Appsignal.configure do |config|
    config.ignore_logs += [
      "^done$",
      "Task .* completed successfully"
    ]
  end
  ```

  ```yaml YAML theme={null}
  production:
    ignore_logs:
      - "^done$"
      - "Task .* completed successfully"
  ```
</CodeGroup>

### Read More {/* id: ruby-read-more */}

* Read more about the [Ruby `ignore_logs` config option][ruby ignore_logs].
* [Logging with AppSignal for Ruby](/logging/integrations/ruby).

## Elixir

To ignore logs in Elixir, add the following to your AppSignal configuration file. The [`ignore_logs`][elixir ignore_logs] value is a List of Strings.

<CodeGroup>
  ```elixir Elixir theme={null}
  config :appsignal, :config,
    ignore_logs: ["^done$", "Task .* completed successfully"]
  ```
</CodeGroup>

### Read More {/* id: elixir-read-more */}

* Read more about the [Elixir `ignore_logs` config option][elixir ignore_logs].
* [Logging with AppSignal for Elixir](/logging/integrations/elixir).

## Node.js

To ignore logs in Node.js, add the following to your AppSignal configuration file. The [`ignoreLogs`][nodejs ignore_logs] value is an Array of Strings.

<CodeGroup>
  ```javascript Node.js theme={null}
  const { Appsignal } = require("@appsignal/nodejs");

  new Appsignal({
    // Other config
    ignoreLogs: ["^done$", "Task .* completed successfully"],
  });
  ```
</CodeGroup>

### Read More {/* id: nodejs-read-more */}

* Read more about the [Node.js `ignoreLogs` config option][nodejs ignore_logs].
* [Logging with AppSignal for Node.js](/logging/integrations/nodejs).

## Go

To ignore logs in Go applications, configure the [`ignore_logs` config option][go ignore_logs].

See the [Go configuration page](/go/configuration/options) for more information on how to configure OpenTelemetry for Go apps.

<CodeGroup>
  ```go Go theme={null}
  res := resource.NewWithAttributes(
  	attribute.StringSlice("appsignal.config.ignore_logs", []string{"^done$", "Task .* completed successfully"}),
  	// And other resource attributes
  )
  ```
</CodeGroup>

### Read More {/* id: go-read-more */}

* Read more about the [Go `ignore_logs` config option][go ignore_logs].

## Java

To ignore logs in Java applications, configure the [`ignore_logs` config option](/java/configuration/options#option-ignore_logs) using the `OTEL_RESOURCE_ATTRIBUTES` environment variable. The `ignore_logs` value is an array of strings.

<CodeGroup>
  ```bash Bash theme={null}
  function encode() {
    echo -n "$@" | sed 's/,/%2C/g'
  }

  export OTEL_RESOURCE_ATTRIBUTES="\
    appsignal.config.ignore_logs=$(encode "^done$,Task .* completed successfully"),\
    ..."
  ```
</CodeGroup>

### Read More {/* id: java-read-more */}

* Read more about the [Java `ignore_logs` config option](/java/configuration/options#option-ignore_logs).

## PHP

To ignore logs in PHP applications, configure the [`ignore_logs` config option](/php/configuration/options#option-ignore_logs). The `ignore_logs` value is an array of strings.

<CodeGroup>
  ```php PHP theme={null}
  return [
      'ignore_logs' => ['^done$', 'Task .* completed successfully'],
      // ... other options
  ];
  ```
</CodeGroup>

### Read More {/* id: php-read-more */}

* Read more about the [PHP `ignore_logs` config option](/php/configuration/options#option-ignore_logs).

[elixir ignore_logs]: /elixir/configuration/options.html#option-ignore_logs

[nodejs ignore_logs]: /nodejs/3.x/configuration/options.html#option-ignorelogs

[ruby ignore_logs]: /ruby/configuration/options.html#option-ignore_logs

[go ignore_logs]: /go/configuration/options.html#option-ignore_logs
