File tree Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Expand file tree Collapse file tree 1 file changed +14
-21
lines changed Original file line number Diff line number Diff line change @@ -24,27 +24,20 @@ protected function initializeLogging()
24
24
$ log = new Logger ('ICL ' , $ this ->getLogHandlers ());
25
25
ErrorHandler::register ($ log );
26
26
27
- $ log ->info ('Hello World! ' );
28
- $ log ->info ('Message with context! ' , [
29
- 'isOkay ' => true ,
30
- 'count ' => 3000 ,
31
- 'type ' => 'cool ' ,
32
- 'objects ' => [
33
- [
34
- 'name ' => 'First ' ,
35
- 'date ' => '2016-06-17 14:15:58 ' ,
36
- ],
37
- [
38
- 'name ' => 'Second ' ,
39
- 'date ' => '2016-06-17 15:15:58 ' ,
40
- ],
41
- [
42
- 'name ' => 'Third ' ,
43
- 'date ' => '2016-06-17 16:15:58 ' ,
44
- ],
45
- ],
46
- ]);
47
- $ log ->error ('Error Test! ' );
27
+ $ class = get_class ($ this );
28
+ $ host = gethostname ();
29
+ $ ip = gethostbyname ($ host );
30
+ $ log ->info ("Command ` {$ class }` initialized. " );
31
+ $ log ->info ("Host: ` {$ host }` (` {$ ip }`). " );
32
+
33
+ if (laravel_db_is_mysql ()) {
34
+ $ dbIp = (string ) laravel_db_mysql_variable ('wsrep_node_address ' );
35
+ $ dbHost = (string ) laravel_db_mysql_variable ('hostname ' );
36
+ $ dbPort = (string ) laravel_db_mysql_variable ('port ' );
37
+ $ now = laravel_db_mysql_now ();
38
+ $ log ->info ("Database host: ` {$ dbHost }`, port: ` {$ dbPort }`, ip: ` {$ dbIp }`. " );
39
+ $ log ->info ("Database date: ` {$ now }`. " );
40
+ }
48
41
}
49
42
50
43
private function getLogHandlers ()
You can’t perform that action at this time.
0 commit comments