totaltekst/logger

A package for logging

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/totaltekst/logger

v0.2.0 2026-01-14 14:01 UTC

This package is auto-updated.

Last update: 2026-01-14 14:20:12 UTC


README

Enables logging through monolog or Google logs

Requirements

  • PHP 8.1+

Note To use Google logging, you need to make sure the application has google credentials set. (Normally through env var GOOGLE_APPLICATION_CREDENTIALS).

Installation

Install the latest version with

composer require totaltekst/logger

Basic Usage for Google logging

<?php

use Totaltekst\Logger\Log;

// Setup to use Google logger, level DEBUG
Log::init_logger('my_app_name', Level::Debug, 'google', 'my-project-id');

// Write to the log using static methods:
Log::alert('Starting up my app', ["data" => $args]);
# 
# 
Log::info('Shutting down');

Basic usage for logging to errorlog using monolog

<?php

use Totaltekst\Logger\Log;

// Setup to use monolog, level DEBUG
Log::init_logger('my_app_name', Level::Debug, 'errorlog');

// Write to the log using static methods:
Log::alert('Starting up my app', ["data" => $args]);
# 
# 
Log::info('Shutting down');