WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit b49c91b

Browse files
committed
Do not use date in the log file name
This allows us use proper log rotate tools e.g logrotate(8)
1 parent 946b53b commit b49c91b

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

app/providers/Logger/ServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function ($filename = null, $format = null) use ($logLevels) {
8484
$filename = rtrim($filename, '.') . '.log';
8585
}
8686

87-
$logger = new File(app_path(sprintf("storage/logs/%s-%s", date('Ymd'), $filename)));
87+
$logger = new File(app_path(sprintf("storage/logs/%s", $filename)));
8888

8989
$logger->setFormatter(new Line($format, $date));
9090
$logger->setLogLevel($level);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[phalcon-docs]
2+
indent_style = tab
3+
tab_width = 4
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ----------------------------------------------------------------------
2+
# logrotate configuration example for Phalcon Documentation Website.
3+
#
4+
# Note: This is just example. Do not use it as is at production systems.
5+
# ----------------------------------------------------------------------
6+
7+
/var/log/acme/*.log {
8+
daily
9+
rotate 7
10+
compress
11+
delaycompress
12+
missingok
13+
create 660 nginx www-data
14+
nodateext
15+
sharedscripts
16+
postrotate
17+
/bin/kill -SIGUSR1 `cat /var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
18+
/bin/kill -USR1 $(cat /var/run/nginx.pid 2>/dev/null) 2>/dev/null || :
19+
endscript
20+
}

storage/setup/nginx.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -----------------------------------------------------------
22
# Nginx configuration for Phalcon Documentation Website
3-
# -----------------------------------------------------------
4-
# Note: This file is used at Scrutinizer CI
5-
# Use this configuration only if you know what you are doing
3+
#
4+
# Note: This file is used at Scrutinizer CI only.
5+
# Do not use it as is at production systems.
66
# -----------------------------------------------------------
77

88
server {

0 commit comments

Comments
 (0)