Update logger.php

This commit is contained in:
Namhyeon Go 2020-06-21 17:16:27 +09:00 committed by GitHub
parent ed06978230
commit 43972172ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,18 +2,25 @@
/**
* @file logger.php
* @created_on 2018-05-27
* @updated_on 2020-06-24
* @updated_on 2020-06-21
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief Logger module for ReasonableFramework
*/
if(!is_fn("append_log_to_file")) {
function append_log_to_file($data, $filename) {
$config = get_config();
$rotate_size = get_value_in_array("log_rotate_size", $config, 0);
$rotate_ratio = get_value_in_array("log_rotate_size", $config, 0.9);
return append_storage_file($data, array(
"storage_type" => "logs",
"filename" => $filename,
"chmod" => 0644,
"nl" => "<",
"rotate_size" => $rotate_size,
"rotate_ratio" => $rotate_ratio,
));
}
}