PenUltima Online

It is currently Sat Sep 06, 2008 6:31 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Logtofile
PostPosted: Wed Mar 26, 2008 2:18 am 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 99
Location: Poland
simple txt command:
Code:
use file;

program txtlog(kto)
LogToFile("e:/FTP/gm/LOGI/gracze/aaa.log", "aaaa",LOG_DATETIME);
endprogram

works just fine

but when i use LogToFile("e:/FTP/gm/LOGI/gracze/aaa.log", "aaaa",LOG_DATETIME); in any package error comes out: "Unable to open file: aaa.log"
How to allow a package to log data anywhere I want (i can log data in some package)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 3:49 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 5:24 am
Posts: 30
I think you need to add proper entry to fileaccess.cfg file.

http://docs.polserver.com/pol097/configfiles.php

For example. I have logging package 'logger' All functions needed for logging stuff goes through this pkg. In fileaccess.cfg i've to add something like this:

Code:
FileAccess logs
{
    Package     *
    Extension   .log
    AllowRemote 1
    AllowWrite  1
    AllowAppend 1
}


That means all packages have file access to *.log files.

_________________
<uninitialized object>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 8:16 am 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 99
Location: Poland
Yes, I have this.

FileAccess
{
Package *
Directory *
Extension .log
AllowRead 1
AllowWrite 1
AllowAppend 1
AllowRemote 1
}

As I wrote I can log anything, but it has to be in any package.

"Unable to open file: commandlog/logs/e:/FTP/gm/LOGI/aaa.log"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 9:15 am 
Offline

Joined: Thu Feb 02, 2006 8:33 am
Posts: 276
You need to set a pol package conform file structure, something like the following example:

Code:
var filename := "::pkg/opt/LogSystem/test.log";
LogToFile( filename, "blahblah" );


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 11:20 am 
Offline

Joined: Tue Mar 20, 2007 7:17 am
Posts: 99
Location: Poland
Well..

So if I use .logtext then I can log it anywhere I want???? (eg. e:/Logs/)
But if I use pkg and log something in it so I must log it in a pkg???

I wander what if I use start_script to start working cmd_txt script...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 26, 2008 1:12 pm 
Offline

Joined: Thu Feb 02, 2006 8:33 am
Posts: 276
Imho you can't give a LogToFile command with a directory outside the pol packages, e.g. a named directory like "harddisk:\dir". If you are a linux user, write a crontab to move these logs into your wanted directory. I personally found no other way yet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl