/** * Appends the 'timestamp' parameter for indexing by Loggly. * * @see https://www.loggly.com/docs/automated-parsing/#json * @see \Monolog\Formatter\JsonFormatter::format() */ public function format(array $record) { if (isset($record["datetime"]) && $record["datetime"] instanceof \DateTime) { $record["timestamp"] = $record["datetime"]->format("Y-m-d\\TH:i:s.uO"); // TODO 2.0 unset the 'datetime' parameter, retained for BC } return parent::format($record); }
/** * Appends the 'timestamp' parameter for indexing by Loggly. * * @see https://www.loggly.com/docs/automated-parsing/#json * @see \Monolog\Formatter\JsonFormatter::format() */ public function format(array $record) { if (isset($record["datetime"]) && $record["datetime"] instanceof \DateTime) { $record["timestamp"] = $record["datetime"]->format("Y-m-d\\TH:i:s.uO"); unset($record["datetime"]); } return parent::format($record); }
/** * Appends the 'hostname' and 'appname' parameter for indexing by Logmatic. * * @see http://doc.logmatic.io/docs/basics-to-send-data * @see \Monolog\Formatter\JsonFormatter::format() */ public function format(array $record) : string { if (!empty($this->hostname)) { $record['hostname'] = $this->hostname; } if (!empty($this->appname)) { $record['appname'] = $this->appname; } return parent::format($record); }
public $dateFormatSeparator = "-"; public $envIdentificationSL = "Emr Nightly Build (NBD19A) 2015-12-22"; public $codeCultureSL = "en-CA"; public $isUserLayoutActive = true; public $isReportServiceActive = true; public $reportServiceUrl = "http://wdevsia4/ReportServer_livrable/ReportService2010.asmx"; public $reportServiceUrlSL = "http://wdevsia4/ReportServer_livrable/ReportService2010.asmx"; public $reportServiceFolder = "/Centre de rapports SIA"; public $reportServiceFolderSL = "/Centre de rapports SIA"; public $isActivateUserOnCreation = true; public $shortTimePattern = "HH:mm"; public $longTimePattern = "HH:mm"; } $Parameter = new Parameter(); $Parameter->Result = new Result(); echo JsonFormatter::prettyPrint(json_encode($Parameter)); class JsonFormatter { public static function prettyPrint(&$j, $indentor = "\t", $indent = "") { $inString = $escaped = false; $result = $indent; if (is_string($j)) { $bak = $j; $j = str_split(trim($j, '"')); } while (count($j)) { $c = array_shift($j); if (false !== strpos("{[,]}", $c)) { if ($inString) { $result .= $c;