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

Environment variables instead of CLI options #256

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

alexv-ds
Copy link
Contributor

@alexv-ds alexv-ds commented Jul 7, 2024

Added the ability for options to take data from environment variables if the option is not specified in the CLI.

Example usage (docker compose):

service:
  my_app:
    image: myimage
    command: node main.js | npx pino-gelf log
    environment:
      PINO_GELF_HOST: log-server.host
      PINO_GELF_PROTOCOL: tcp
      PINO_GELF_RECONNECTION_DELAY: 2000
      PINO_GELF_KEEP_ALIVE: false
Property Environment Variable Default
Host PINO_GELF_HOST 127.0.0.1
Port PINO_GELF_PORT 12201
Protocol PINO_GELF_PROTOCOL udp
Maximum Chunk Size PINO_GELF_MAX_CHUNK_SIZE 1420
Keep Alive PINO_GELF_KEEP_ALIVE true
Reconnection limit PINO_GELF_RECONNECTION_LIMIT -1 (no limit)
Reconnection delay PINO_GELF_RECONNECTION_DELAY 1000
Verbose Logging - false
Passthrough - false

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alexv-ds
Copy link
Contributor Author

alexv-ds commented Jul 25, 2024

Rebased master onto env-options branch
#257

@mcollina mcollina merged commit faa25d3 into pinojs:master Jul 25, 2024
11 checks passed
@alexv-ds alexv-ds deleted the env-options branch July 25, 2024 13:40
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