classes/Utilities/Logging/DatabaseLogger.php
public function csv() {
        global $wpdb;

        $fd = fopen('php://temp/maxmemory:1048576', 'w');
        fputcsv($fd, ["date", "channel", "level", "message", "context"]);

        $rows = $wpdb->get_results("select date, channel, level, message, context from {$this->table} order by id asc", ARRAY_N);

        if (is_array($rows) && count($rows) > 0) {
            foreach($rows as $row) {
                fputcsv($fd, $row);
            }
        }

        rewind($fd);
        $csv = stream_get_contents($fd);
        fclose($fd);

        return $csv;
    }
public function csv() {
        global $wpdb;

        $fd = fopen('php://temp/maxmemory:1048576', 'w');
        fputcsv($fd, ["date", "channel", "level", "message", "context"]);

        $rows = $wpdb->get_results("select date, channel, level, message, context from {$this->table} order by id asc", ARRAY_N);

        if (is_array($rows) && count($rows) > 0) {
            foreach($rows as $row) {
                fputcsv($fd, $row);
            }
        }

        rewind($fd);
        $csv = stream_get_contents($fd);
        fclose($fd);

        return $csv;
    }
public function csv ( ) { global $ wpdb ; $ fd = fopen ( 'php://temp/maxmemory:1048576' , 'w' ) ; fputcsv ( $ fd , [ "date" , "channel" , "level" , "message" , "context" ] ) ; $ rows = $ wpdb -> get_results ( "select date, channel, level, message, context from {$this->table} order by id asc" , ARRAY_N ) ; if ( is_array ( $ rows ) && count ( $ rows ) > 0 ) { foreach ( $ rows as $ row ) { fputcsv ( $ fd , $ row ) ; } } rewind ( $ fd ) ; $ csv = stream_get_contents ( $ fd ) ; fclose ( $ fd ) ; return $ csv ; }
Exports the log to CSV

@return bool|string
Exports the log to CSV