newlines in apache http error log

111 views
Skip to first unread message

bryan....@gmail.com

unread,
May 14, 2020, 1:40:32 PM5/14/20
to lnav
Hello,

Could you point me towards documentation on how to make "\n" characters into newlines?

Basically I'm hoping to pretty-print the PHP errors that are in my Apache http error log, but Shift-P isn't doing it.  Is there way to add "break on \n" into pretty print with a config file or something?

Example input:

[Thu May 14 10:58:36.308816 2020] [php7:notice] [pid 1010] [client xx.xxx.xxx.x:xxxxx] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to someClass::setCurrentSelections() must be an instance of strin, string given, called in /usr/local/www/data/book.php on line 1687 and defined in /usr/local/www/data/book.php:1609\nStack trace:\n#0 /usr/local/www/data/book.php(1687): someClass::setCurrentSelections(1461, 'remote...', '["Proxy"...')\n#1 /usr/local/www/data/some    file.php(717): utility->edit(false)\n#2 /usr/local/www/data/somefile.php(3961):

(etc., etc.)



Desired output:

[Thu May 14 10:58:36.308816 2020] [php7:notice] [pid 1010] [client xx.xxx.xxx.x:xxxxx] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to someClass::setCurrentSelections() must be an instance of strin, string given, called in /usr/local/www/data/book.php on line 1687 and defined in /usr/local/www/data/book.php:1609
Stack trace:i
#0 /usr/local/www/data/book.php(1687): someClass::setCurrentSelections(1461, 'remote...', '["Proxy"...')
#1 /usr/local/www/data/somefile.php(717): utility->edit(false)
#2 /usr/local/www/data/somefile.php(3961):

(etc., etc.)


Any insight is appreciated!


Timothy Stack

unread,
May 20, 2020, 1:35:23 AM5/20/20
to bryan....@gmail.com, lnav
On Thu, May 14, 2020 at 10:40 AM <bryan....@gmail.com> wrote:
Hello,

Could you point me towards documentation on how to make "\n" characters into newlines?
 
Basically I'm hoping to pretty-print the PHP errors that are in my Apache http error log, but Shift-P isn't doing it.  Is there way to add "break on \n" into pretty print with a config file or something?

I've pushed a change to try and fix this in the pretty-print view, if you
are able to build from the top-of-tree and give it a try.

thanks for the heads-up,

tim


 
Example input:

[Thu May 14 10:58:36.308816 2020] [php7:notice] [pid 1010] [client xx.xxx.xxx.x:xxxxx] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to someClass::setCurrentSelections() must be an instance of strin, string given, called in /usr/local/www/data/book.php on line 1687 and defined in /usr/local/www/data/book.php:1609\nStack trace:\n#0 /usr/local/www/data/book.php(1687): someClass::setCurrentSelections(1461, 'remote...', '["Proxy"...')\n#1 /usr/local/www/data/some    file.php(717): utility->edit(false)\n#2 /usr/local/www/data/somefile.php(3961):

(etc., etc.)



Desired output:

[Thu May 14 10:58:36.308816 2020] [php7:notice] [pid 1010] [client xx.xxx.xxx.x:xxxxx] PHP Fatal error:  Uncaught TypeError: Argument 3 passed to someClass::setCurrentSelections() must be an instance of strin, string given, called in /usr/local/www/data/book.php on line 1687 and defined in /usr/local/www/data/book.php:1609
Stack trace:i
#0 /usr/local/www/data/book.php(1687): someClass::setCurrentSelections(1461, 'remote...', '["Proxy"...')
#1 /usr/local/www/data/somefile.php(717): utility->edit(false)
#2 /usr/local/www/data/somefile.php(3961):

(etc., etc.)


Any insight is appreciated!


--
You received this message because you are subscribed to the Google Groups "lnav" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lnav+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lnav/10c4722f-7155-4e76-bbbe-01743b8def80%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages