@@ -58,6 +58,11 @@ class LoggerBuilder
5858 */
5959 const EMERGENCY = 600 ;
6060
61+ /**
62+ * @see \Monolog\Logger::$name
63+ */
64+ const DEFAULT_CHANNEL = 'PhpJsonLogger ' ;
65+
6166 /**
6267 * @see \Monolog\Processor\IntrospectionProcessor::$skipClassesPartials
6368 */
@@ -78,6 +83,12 @@ class LoggerBuilder
7883 */
7984 private $ traceId ;
8085
86+ /**
87+ * @var string
88+ * @see \Monolog\Logger::$name
89+ */
90+ private $ channel ;
91+
8192 /**
8293 * @var int
8394 */
@@ -114,8 +125,9 @@ class LoggerBuilder
114125 public function __construct (string $ traceId = '' )
115126 {
116127 $ this ->traceId = $ traceId ;
117- $ this ->logLevel = self ::INFO ;
118- $ this ->fileName = '/tmp/php-json-logger.log ' ;
128+ $ this ->setChannel (self ::DEFAULT_CHANNEL );
129+ $ this ->setLogLevel (self ::INFO );
130+ $ this ->setFileName ('/tmp/php-json-logger.log ' );
119131 $ this ->setSkipClassesPartials (self ::DEFAULT_SKIP_CLASSES_PARTIALS );
120132 $ this ->setSkipStackFramesCount (self ::DEFAULT_SKIP_STACK_FRAMES_COUNT );
121133 $ this ->setMaxFiles (self ::DEFAULT_MAX_FILES );
@@ -137,6 +149,22 @@ public function setTraceId(string $traceId)
137149 $ this ->traceId = $ traceId ;
138150 }
139151
152+ /**
153+ * @return string
154+ */
155+ public function getChannel (): string
156+ {
157+ return $ this ->channel ;
158+ }
159+
160+ /**
161+ * @param string $channel
162+ */
163+ public function setChannel (string $ channel )
164+ {
165+ $ this ->channel = $ channel ;
166+ }
167+
140168 /**
141169 * @return int
142170 */
0 commit comments