Warning

The Coralogix PHP SDK will End of Life(EOL) Feb 1st 2024.
For PHP 7.4+, please use the Coralogix’s PHP OpenTelemetry Instrumentation Documentation instead.

LoggerManager

class Coralogix\LoggerManager
Class LoggerManager
Parent:

Coralogix\HttpSender

Properties

public static property Coralogix\LoggerManager::$configured
Type:

bool is logger manager configured

Methods

public Coralogix\LoggerManager::__construct(array $params, bool $sync_time=true)
Initialize logger manager instance
Parameters:
  • $params (array) configuration parameters(privateKey, applicationName, subsystemName)

  • $sync_time (bool) synchronize local time with Coralogix servers

public Coralogix\LoggerManager::__destruct()
Stop logger manager on exit
public Coralogix\LoggerManager::run()
Target function for thread in which executing logs sending process
public Coralogix\LoggerManager::stop()
Stop logger manager
public Coralogix\LoggerManager::flush()
Send all logs to Coralogix before exit
public Coralogix\LoggerManager::get_buffer_size(bool $in_bytes=false) int
Get size of logs buffer
Parameters:
  • $in_bytes (bool) return in bytes or in count of entries

Returns:

int buffer size

public Coralogix\LoggerManager::add_logline($message, int $severity, string $category=NULL, array $params=array\(\))
Add logs line to logs buffer
Parameters:
  • $message (string) log record text

  • $severity (int) log record level

  • $category (string) log record category

  • $params (array) additional log record fields(className, methodName, threadId)

public Coralogix\LoggerManager::msg2str($message) string
Format message string to correct format
Parameters:
  • $message (string) log record text

Returns:

string formatted string