PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Logtofile

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Scripting Help
Display posts from previous:   

Author Message
coltain



Joined: 20 Mar 2007
Posts: 96
Location: Poland

PostPosted: Wed Mar 26, 2008 6:18 am    Post subject: Logtofile Reply with quote

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)

Author Message
AsYlum



Joined: 05 Feb 2006
Posts: 30

PostPosted: Wed Mar 26, 2008 7:49 am    Post subject: Reply with quote

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.

Author Message
coltain



Joined: 20 Mar 2007
Posts: 96
Location: Poland

PostPosted: Wed Mar 26, 2008 12:16 pm    Post subject: Reply with quote

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"

Author Message
Pierce



Joined: 02 Feb 2006
Posts: 256

PostPosted: Wed Mar 26, 2008 1:15 pm    Post subject: Reply with quote

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" );

Author Message
coltain



Joined: 20 Mar 2007
Posts: 96
Location: Poland

PostPosted: Wed Mar 26, 2008 3:20 pm    Post subject: Reply with quote

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...

Author Message
Pierce



Joined: 02 Feb 2006
Posts: 256

PostPosted: Wed Mar 26, 2008 5:12 pm    Post subject: Reply with quote

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.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty