ユーザ用ツール

サイト用ツール


サイドバー



最近の更新



Tag Cloud

タグ#
6
10
1
3
1
2
17
7
1
1
6
12
4
1
2
201
1
6
2
7
14
5
1
27
3
3
1
6
1
1
41
1
3
3
1
1
1
1
1
1
23
46
7
9
10
5
10
3
3
2
8
2
2
6
5
1
1
4
9
4
3
3
2
1
8
2
4
1
5
27
2
12
2
3
1
1
2
2
1
1
1
4
3
2
4
2
2
1
1
2
1
2
1
2
1
26
2
1
2
2
2
1
1
2
3
13
5
8
1
1
2
12
1
5
1
2
7
1
1
1
1
1
8
1
5
2
1
1
1
3
3
10
1
2
1
1
7
3
1
10
1
1
4
1
2
1
2
7
2
1
3
1
1
3
1
2
1
2
2
2
1
2
3
1
2
3
4
1
3
1
3
3
2
1
1
7
1
3
3
1
1
1
1
5
1
32
2
1
2
1
2
2
3
1
1
1
3
1
2
1
1
1
3
1
1
1
2
4
2
1
1
1
3
1
2
4
2
1
2
1
1
1
1
2
1
1
11_php:02_framework:03_silex_monolog

03 Silex Monolog

use Silex\Provider\MonologServiceProvider;
$app->register(new Silex\Provider\MonologServiceProvider(), array(
  'monolog.name' => 'AAAA',
  'monolog.logfile' => __DIR__.'/log/my_app.log',
  'monolog.maxfiles' => 7,
  'monolog.level' => constant("Monolog\Logger::DEBUG"),
));

// ログ書き込み
$app['monolog']->addDebug('debug log');
$app['monolog']->addInfo('info log');
$app['monolog']->addWarning('warning log');
$app['monolog']->addError('error log');

出力されるログ

[2019-02-07 11:47:15] AAAA.DEBUG: debug log [] []
[2019-02-07 11:47:15] AAAA.INFO: info log [] []
[2019-02-07 11:47:15] AAAA.WARNING: warning log [] []
[2019-02-07 11:47:15] AAAA.ERROR: error log [] []
11_php/02_framework/03_silex_monolog.txt · 最終更新: 2019/02/07 11:51 by matsui

Yesterday:1461 Today:1614 Total:03075