Skip to content

Commit 73c66eb

Browse files
Configurable Logging - Defaults to STDIN
1 parent 0340e98 commit 73c66eb

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ TWITTER_CLIENT_ID=
2121
TWITTER_CLIENT_SECRET=
2222

2323
REDIS_URL=tcp://127.0.0.1:6379
24+
25+
LOGGER_PATH=logs/app.log

app.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
"description": "PGP Verification API URL",
8686
"value": "",
8787
"required": false
88+
},
89+
"LOGGER_PATH": {
90+
"description": "File path for logging (defaults to stdin)",
91+
"value": "php://stdin",
92+
"required": true
8893
}
8994
},
9095
"formation": {

lib/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function installDB() {
4646

4747
function make_logger($channel) {
4848
$log = new Logger($channel);
49-
$log->pushHandler(new StreamHandler(dirname(__FILE__).'/../logs/app.log', Logger::DEBUG));
49+
$log->pushHandler(new StreamHandler(getenv('LOGGER_PATH'), Logger::DEBUG));
5050
$log->pushProcessor(new Monolog\Processor\WebProcessor);
5151
return $log;
5252
}

0 commit comments

Comments
 (0)