Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata_filter able to group multiple application logs #78

Conversation

edwardzhou
Copy link

Scenario:
there are several applications in an umbrella project. eg

finance_umbrella/
   apps/
       client_portal/
       client_portal_web/
       crm/
       crm_web/
       ...

in such case. we prefer to log both client_portal and client_portal_web into a single log file client_portal.log, instead of two isolated files client_portal.log client_portal_web.logs.

So we enhance metadata_filter supports array.

config :logger,
  backends: [
    {LoggerFileBackend, :client_portal},
    {LoggerFileBackend, :crm}
  ]

config :logger, :client_portal,
  path: "/path/to/client_portal.log",
  level: :info,
  metadata_filter: [application: [:client_portal, :client_portal_web]]

config :logger, :client_portal,
  path: "/path/to/crm.log",
  level: :info,
  metadata_filter: [application: [:crm, :crm_web]]

@PoohOka
Copy link

PoohOka commented Oct 22, 2021

Totally agree with this option especially in umbrella project with external dependencies like Testla and multiple Phoenix apps.

@fireproofsocks
Copy link
Collaborator

I'll merge this, but I'm still awaiting being granted hex ownership per Issue #75
Until I have that, I can't actually publish a new version of the package.

@fireproofsocks fireproofsocks merged commit 6c3c906 into onkel-dirtus:master Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants