tests/FeatureTest.php
/**
     * Feature test for a writing log message format.
     *
     * @return void
     */
Feature test for a writing log message format.
@return void
Feature test for a writing log message format . @return void
public function testWriting(): void
    {
        event(new class extends AbstractLoggableEvent {
            public function logMessage(): string
            {
                return 'foo message';
            }
        });
        $this->assertLogFileContains('"source":"UNKNOWN"', $events_log = 'laravel-events.log');
        $this->assertLogFileContains('"type":"UNKNOWN"', $events_log);
        $this->assertLogFileContains($this->app->environment() . '.INFO: foo message', $events_log);
        $this->assertLogFileContains('"entry_type":"event"', $events_logstash_log = 'logstash/laravel-events.log');
        $this->assertLogFileContains('"level":"INFO"', $events_logstash_log);
        $this->assertLogFileContains('"event":{', $events_logstash_log);
        $this->assertLogFileContains('"message":"foo message"', $events_logstash_log);
    }
public function testWriting ( ) : void { event ( new class extends AbstractLoggableEvent { public function logMessage ( ) : string { return 'foo message' ; } } ) ; $ this -> assertLogFileContains ( '"source":"UNKNOWN"' , $ events_log = 'laravel-events.log' ) ; $ this -> assertLogFileContains ( '"type":"UNKNOWN"' , $ events_log ) ; $ this -> assertLogFileContains ( $ this -> app -> environment ( ) . '.INFO: foo message' , $ events_log ) ; $ this -> assertLogFileContains ( '"entry_type":"event"' , $ events_logstash_log = 'logstash/laravel-events.log' ) ; $ this -> assertLogFileContains ( '"level":"INFO"' , $ events_logstash_log ) ; $ this -> assertLogFileContains ( '"event":{' , $ events_logstash_log ) ; $ this -> assertLogFileContains ( '"message":"foo message"' , $ events_logstash_log ) ; }
Feature test for a writing log message format.
Feature test for a writing log message format .