Willyan
Willyan

Reputation: 133

Is there a similar filter for Quarkus logs like filter-spec from Thorntail?

I am trying to create some profile filters on Quarkus as I had in Thorntail, but I didn't can apply the filter. The only documentation regarding filters in the Quarkus documentation is: quarkus.log.filter."filters".if-starts-with But I need to use a regular expression to filter my logs.

Here is one of the profiles that I have:

Thorntail approach:

SERVER_ERROR:
  named-formatter: SERVER_ERROR
  file:
    path: logs/myapp-server-erros.log
  suffix: .yyyy-MM-dd
  filter-spec: "match(\"httpStatusCode=5[0, 9][0, 9]\")"

On Quarkus I created some profiles handlers as I needed and the log files were created as expected, but the filters don't work.

Quarkus expected approach:

SERVER_ERROR:
  enable: true
  format: 'my regular expression'
  path: logs/myapp-server-erros.log
  rotation:
    max-file-size: 512M
    file-suffix: .yyyy-MM-dd
    max-backup-index: 100
    filter: "match(\"httpStatusCode=5[0, 9][0, 9]\")"

Does anyone have an idea how can I apply the regular expression to filter logs in one profile handler?

Upvotes: 1

Views: 120

Answers (0)

Related Questions