Skip to content

salsadigitalauorg/laravel_lagoon_logs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lagoon Logs for Laravel

Monolog channel and formatter for Laravel logging into Lagoon.

Basic Usage

Installing this package makes the channel lagoon available in your logging config.

You can install the package by simply running composer require amazeeio/lagoon-logs - the package should be installed and autodiscovered by Laravel.

It's important to note that this is essentially a wrapper around a Monolog Logger with a specifically set UDP SocketHandler and LogstashFormatter - therefore, it really only makes sense to use this when deployed to a Lagoon instance.

In a vanilla Laravel installation, this is most easily done by setting the environment variable LOG_CHANNEL to lagoon.

Advanced Usage

This package provides a default configuration via ./config/logging.php that will be merged with your application's ./config/logging.php. If you need more control over your logging stack, you can simply override the default config by adding lagoon channel in your ./config/logging.php file.

For instance, if you need to configure a custom formatter, you can add:

'lagoon' => [
    'tap' => [App\Logging\CustomizeFormatter::class],
],

See the Laravel docs for more on customizing logging.

Additionally, the following environmental variables are available:

LOG_LEVEL=debug
LAGOON_LOGS_HOST="application-logs.lagoon.svc"
LAGOON_LOGS_PORT=5140
LAGOON_LOGS_IDENTIFIER="my-application"

Note, if LAGOON_LOGS_IDENTIFIER value is not provided then this package will attempt to create it by looking up Lagoon environment details using a combination LAGOON_PROJECT and LAGOON_GIT_SAFE_BRANCH.

About

Zero config Monolog channel and formatter for Laravel logging into Lagoon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%