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.

Filename of logfiles when using "keep-all-logs 1"

Old posts that have not been replied to for several years.
Locked
A
Alpha
Voice
Posts: 15
Joined: Sat Nov 27, 2004 12:27 am
Location: Tromsø, Norway
Contact:

Filename of logfiles when using "keep-all-logs 1"

Post by Alpha »

Hi!


When using "keep-all-logs 1", eggdrop saves the logfiles with channelname.log.dateyear (ie: wherever.log.17Jul2005). I dump all the files to a folder publically available on a webserver, but no browser understands what a 17Jul2005-file is and thus order the user to download the file and then open it manually in a texteditor.

Is there a quick way around this, to name it something like: "2005.Jul.17.channel.log"? Or do I have to write a TCL that does the job?
B
Big Jay
Voice
Posts: 4
Joined: Wed Jul 13, 2005 3:25 pm

Post by Big Jay »

maybee if u kno php make an index.php for the folder there in

make the php file list the names of each file creating a link for each one

when you click the link php takes the text out of the file and prints it on screen

??
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

if the webserver is apache, add to .htaccess file for that public directory (or to server's config if you are the admin) this line:

AddType text/plain .log
A
Alpha
Voice
Posts: 15
Joined: Sat Nov 27, 2004 12:27 am
Location: Tromsø, Norway
Contact:

Post by Alpha »

Solution with .htaccess worked for some files, but not all of them..?!

Check it out: http://www.kanaltromso.no/tromsolog/
L
LtPhil
Voice
Posts: 26
Joined: Mon Jul 28, 2003 10:25 am

Post by LtPhil »

use this .htaccess instead:

Code: Select all

<Files ~ "^.+\.log.*$">
  ForceType text/plain
</Files>
that will force all files with ".log" anywhere in the name (except at the beginning) to be of text/plain type.

hope this helps :)

alpha, if you'd like a PHP script like what big jay was suggesting, i can whip one up for you - just PM me on the forums here (this is, after all, an eggdrop forum and not a PHP forum ;))

P.S.: demond, i don't think your suggestion worked because the filenames don't end in .log, which is all that AddType checks for.
A
Alpha
Voice
Posts: 15
Joined: Sat Nov 27, 2004 12:27 am
Location: Tromsø, Norway
Contact:

Post by Alpha »

Still doesn't work, which is strange...

tromso.log.01Jun2003 02-Jun-2003 00:00 737k
tromso.log.01Jun2004 02-Jun-2004 00:00 492k


The top one works, the bottom one doesn't. I thought it was a filesize issue, but the top one is bigger than the latter... This isn't an Apache / html forum so I should probably take this someplace else. Or bother with a php-script.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

you know you can change the name using the 'set logfile-suffix' settting in your config.
Locked