This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

PHP script to highlight log files

Old posts that have not been replied to for several years.
Locked
A
Arnar

PHP script to highlight log files

Post by Arnar »

Hello out there..

I wrote a PHP script to highlight my log files in a web browser. Thought it might be useful to someone out there. There are samples of it's output at http://www.hi.is/~arnarbi/shot1.html and http://www.hi.is/~arnarbi/shot2.html. I don't have any logs from a real channel, if anyone tries this out with actual data and could post samples, it would be wonderful. Btw. the blue-background highlighted strings in shot1.html were acquired by using an url like http://kassi.oddi.is/~arnarb/irc-loggar ... ?hi=eggert (this url is not publicly available).

It's simple to set up, put your logfiles in a directory available to your web server, use a .htaccess file to define an action for text/plain files which serves them through the script. Step-by-step instructions are found inside the script itself.

It has the following features:
- higlights channel logs (logged with jpk flags)
- reckognizes all 16 irc colors, bold and underline formatting
- makes urls clickable
- inserts "silence for m hours n minutes" where appropriate
- no preprocessing needed, acts as a http handler for text/plain files
- highlighting of search string if "?hi=whatever" is appended to the url

The script is available at http://www.hi.is/~arnarbi/formatter.txt, just change the .txt ending to .php, .php4 or whatever your webserver uses.

Arnar
A
Arnar

Note on the hyperlinks above..

Post by Arnar »

Hyperlinks to shot2.html and formatter.txt include a dot and a comma, respectively. This was BB's doing, you have to remove them manually, sorry.

Arnar
User avatar
stere0
Halfop
Posts: 47
Joined: Sun Sep 23, 2001 8:00 pm
Location: Brazil

Bad Request

Post by stere0 »

Bad Request
Your browser sent a request that this server could not understand.
Invalid URI in request GET /logs/channel.log HTTP/1.0



Can u help me?
[]s
A
Arnar

Re: Bad request

Post by Arnar »

What does your .htaccess undir <webroot>/logs contain?

Arnar
User avatar
stere0
Halfop
Posts: 47
Joined: Sun Sep 23, 2001 8:00 pm
Location: Brazil

log

Post by stere0 »

server:~# tail /usr/local/apache/logs/server.error_log
[Wed Sep 10 21:11:31 2003] [error] [client ip] Invalid URI in request GET /logs/channel.log HTTP/1.0



can u see?
[]s
a
adleZ

Post by adleZ »

Cool, i was looking for this! =)
I haven't tested it yet, but sounds good =)
a
adleZ

Post by adleZ »

Hm, i got errors too

Internal Server Error

The Error Log said:
[Fri Sep 12 00:01:46 2003] [alert] [client 192.168.0.2] ../logs/.htaccess: Action not allowed here



"Action text/plain /web/path/to/.formatter.php"
the "Action" command he don't understands...

What could it be ?
a
adleZ

Post by adleZ »

Oh nevermind, i solved the error
but now i got this

PHP Parse error: parse error, unexpected ';' in /logs/formatter.php on line 46

This is about your code, no ?
a
adleZ

Post by adleZ »

LOL, more one post!

Now it's working

There is an error on line 46 of your program
in the end of the line, where it says:
"($period/60,"hour","hours");"

add just a ")" before the ";", like this:

($period/60,"hour","hours"));

and it should work correctly now ( for me it's perfect ! )

Please update your file!

Thanks for this script, i was looking for this for months !

Bye
Locked