Skip to content
Permalink
Browse files

Improve logging from Monolog

  • Loading branch information
flodolo committed Aug 19, 2016
1 parent 37b5b0b commit 4f53eceb33030bb3674590990a39570d923b137a
Showing with 5 additions and 2 deletions.
  1. +4 −1 app/inc/init.php
  2. +1 −1 app/models/tmx_downloading.php
@@ -2,6 +2,7 @@
namespace Transvision;

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

// We always work with UTF8 encoding
@@ -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;
@@ -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;

0 comments on commit 4f53ece

Please sign in to comment.
You can’t perform that action at this time.