😯
AstridLogger
  • What is AstridLogger?
  • Guides
    • Creating your first log
    • Advanced configuration
  • Use Cases
    • Error notifications
Powered by GitBook
On this page
  • Using a custom config
  • Discord integration
  • Twilio integration
  • Variables
  • Disabling certain integrations
  1. Guides

Advanced configuration

Learn how to configure AstridLogger

PreviousCreating your first logNextError notifications

Last updated 3 years ago

Good to know: AstridLogger can work perfectly fine without any additional configuration, but configuring it makes it 100x better.

Using a custom config

Here is a basic example of using a custom configuration to change log colors.

Discord integration

You can easily implement Discord into your applications using AstridLogger! But, how?

Create a "discord" object within your configuration, and then fill in what you will use. In order to use the Discord integration, make sure to set enabled to true!

You can swap them out for success, or for error as well.

Twilio integration

You no longer have to implement Twilio yourself, as AstridLogger can handle it!

Create a "twilio" object within your configuration, and fill in the following values

The Twilio support also includes "errorContent", as shown within the Discord configuration! If no errorContent is specified, it will default to the text provided within the log statement.

Variables

Now, how does one get actual information? It's relatively easy.

Variables are surrounded by double braces ({{example}}) to distinguish them from other text, and they can be used in any "content" option.

  • file (Name of the file that executed the log)

  • path

  • content

  • time (Formatted time using DayJS)

  • unix

  • used_memory

  • total_memory

  • free_memory

Disabling certain integrations

You can disable a certain integration for a specific log by adding the following to your log options

disableDiscord: true
// or
disableTwilio: true

Example below:

Basic Discord integration
Basic Twilio configuration