Author Topic: New IP Logger - Not Logging...  (Read 1504 times)

Alright, so I got some help with this one and its still not working...Anyone have any ideas?  It has no console errors, but it doesn't log anything, or even create the log file.  

Code: [Select]
$logFile = "config/server/TezLogs/IPAddresses.cs";

//Checks if log already exists, if so, load log.
if(isFile($logFile))
{
    exec($logFile);
}

//Package for automatically logging and saving IP addresses.
package IPLog
{
    function GameConnection::AutoAdminCheck(%client)
    {
       $LoggedIP[%client.BL_ID] = %client.getRawIP();
       export("$LoggedIP*", $logFile, false);
      
       return Parent::AutoAdminCheck(%client);
    }
};
activatepackage(IPLog);

Why do you have the log as a cs file?

Why do you have the log as a cs file?

Because I can.  Thanks for the help.

LogWriter.
Just stick to what's already made

LogWriter.
Just stick to what's already made

Has errors and doesn't log IP(Unless you updated recently) and the download fails


Because I can.  Thanks for the help.
Hurpadurp. .txt plz


Now lock this.

Uh, no.  Your logger creates massive files that take forever to open and it gets real spammy.  My code here only logs everyone's IP once, not for every connection and disconnection. 

Uh, no.  Your logger creates massive files that take forever to open and it gets real spammy.  My code here only logs everyone's IP once, not for every connection and disconnection. 
Stop being stupid
Just empty the files.

Stop being stupid

Right, because avoiding massive spammy files and putting quality into something is stupid.

Right, because avoiding massive spammy files and putting quality into something is stupid.
Where else can the logs go?

Where else can the logs go?

You could make it keep a log history until the file reaches a reasonable size, then have it start deleting as new lines are added.

Nvm I got it working now, locking.

@Jimmg - Writing to a cs file is fine since he intends to execute it each time the script loads to import the list of existing IPs.

However, the list soon gets so big that actually reading it in line-by-line using a fileobject would be much faster than executing the entire file in one go.

Also, don't lock Coding Help threads.