Skip to content

Commit

Permalink
Improve logging from Monolog
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo committed Aug 19, 2016
1 parent 37b5b0b commit 4f53ece
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Transvision;

use Monolog\Handler\StreamHandler;
use Monolog\Formatter\LineFormatter;
use Monolog\Logger;

// We always work with UTF8 encoding
Expand Down Expand Up @@ -34,7 +35,9 @@

// Logging
$logger = new Logger(VERSION);
$logger->pushHandler(new StreamHandler(INSTALL_ROOT . 'logs/transvision.log', Logger::DEBUG));
$handler = new StreamHandler(INSTALL_ROOT . 'logs/transvision.log');
$handler->setFormatter(new LineFormatter(null, null, false, true));
$logger->pushHandler($handler, Logger::DEBUG);

// Create a Search object with default values available everywhere
$search = new Search;
Expand Down
2 changes: 1 addition & 1 deletion app/models/tmx_downloading.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function ($e) {

if ($content) {
if (! file_put_contents($target_file_path, $content)) {
$logger->error("Can't write into web/download folder");
$logger->error('Can\'t write into web/download folder');
}
} else {
$empty_TMX = true;
Expand Down

0 comments on commit 4f53ece

Please sign in to comment.