Jump to content
Sign in to follow this  

Logging data into a .log file,how?

Recommended Posts



I made a server which is resending packets from a client to another server and modify some of the recv packets from the other server before they get to the client.

The packets I get are a lot and most of them are most likely completely useless,instead WPE ,it would be easier to me if i could read them from a txt file without the useless packets.

Well,I can add a if stringLeft($Packet... to ignore the useless data,but i've never worked with log files in au3,i could do it in delphi,but everything is easier in au3.

So,basically i've got all running except the log function,please help.

Edited by H5O2OH

Share this post

Link to post
Share on other sites

Here is what you're after:



Writes current date,time and the specified text to a log file.

#Include <File.au3>

_FileWriteLog($sLogPath, $sLogMsg[, $iFlag = -1])


$sFilePath Path and filename of the file to be written to

$sLogMsg Message to be written to the log file

$iFlag [Optional] - Flag that defines if $sLogMsg will be written to the end of file, or to the begining.

If $iFlag = -1 (default) $sLogMsg will be written to the end of file.

If $iFlag <> -1 $sLogMsg will be written to begining of file.

Return Value

Success: Returns a 1

Failure: Returns a 0

@Error: 0 = No error.

1 = Error opening specified file

2 = File could not be written to

Help file quote.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post

Link to post
Share on other sites

#include <file.au3>


_FileWriteLog(@ScriptDir & "\my.log","Text 1")


_FileWriteLog(@ScriptDir & "\my.log","Text 2")

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.