logging with a batch file
logging with a batch file
what command do I put in a batch file to make it log to a file ???
I have tried
set LOGFILE="C:\bzflag\logger.txt"
thanks to meteor for the code
but that didn't work
thank a bunch
Win Xp
I have tried
set LOGFILE="C:\bzflag\logger.txt"
thanks to meteor for the code
but that didn't work
thank a bunch
Win Xp
- A Meteorite
- Private First Class
- Posts: 1786
- Joined: Thu Apr 28, 2005 12:56 am
- Location: California, U.S.
- Contact:
It should of worked... I modded it to include "> %LOGFILE%" at the end of the command that starts bzfs. Did you try the whole script? Maybe you overlooked that change I did.
Code: Select all
@echo off
set BZFSPROGRAM="C:\bzflag\bzfs.exe"
set CONFIGFILE="C:\bzflag\tankball_conf.txt"
set LOGFILE="C:\bzflag\logger.txt"
REM ***** Don't change anything below this line! *****
@echo on
%BZFSPROGRAM% -conf %CONFIGFILE% > %LOGFILE%
pause
Owner @ BZFX
Core Admin @ CAN
Email me: bzmet…@gmail.com
Re: logging with a batch file
You mean you haven't been logging? Set up a log before you turn on your computer again!Win Xp wrote:what command do I put in a batch file to make it log to a file ???
I have tried
set LOGFILE="C:\bzflag\logger.txt"
thanks to meteor for the code
but that didn't work
thank a bunch
Win Xp
Re: logging with a batch file
You want him to set up logging for his server if his computer is turned off?!Ice Wewe wrote:You mean you haven't been logging? Set up a log before you turn on your computer again!
Re: logging with a batch file
brad2901 wrote:You want him to set up logging for his server if his computer is turned off?!Ice Wewe wrote:You mean you haven't been logging? Set up a log before you turn on your computer again!
That's the general idea, maybe get those lovely expensive data recovery guys to add the log before he turns on his PC...
Perhaps you need to (excuse my linux term) 'touch' the file. As in make an empty file where the log is supposed to go. Perhaps it needs something there to overwite?Win Xp wrote:it seem metoer that that still won't write any info to the logging file????
odd
- A Meteorite
- Private First Class
- Posts: 1786
- Joined: Thu Apr 28, 2005 12:56 am
- Location: California, U.S.
- Contact:
OK, the try deleting the empty file. Can't hurt...Win Xp wrote:I have a empty file where the log is
Also try adding another ">" to the other ">". I hear some people have to use two of them. (">>")
Code: Select all
@echo off
set BZFSPROGRAM="C:\bzflag\bzfs.exe"
set CONFIGFILE="C:\bzflag\tankball_conf.txt"
set LOGFILE="C:\bzflag\logger.txt"
REM ***** Don't change anything below this line! *****
@echo on
%BZFSPROGRAM% -conf %CONFIGFILE% >> %LOGFILE%
pause
Owner @ BZFX
Core Admin @ CAN
Email me: bzmet…@gmail.com
OK the explanation for the > versus the >> is that > creates a new file when the log is started and >> appends to the existing file. If you use > it will delete the file that is there and start a new blank file. Also the only thing that will be returned in the way you are using it are things that are sent to 'stout' or the return value of the executing program, if it returns one.
What kind of logs are you looking for?? Something like what thumper has in tect format? I do not think that the bzfs file echos all of that info out through 'stout' so it can be captured using the method you are trying. Thumper uses plugins to get that information. I saw no mention on the manual page for bzfs to send that info to a file either.
What kind of logs are you looking for?? Something like what thumper has in tect format? I do not think that the bzfs file echos all of that info out through 'stout' so it can be captured using the method you are trying. Thumper uses plugins to get that information. I saw no mention on the manual page for bzfs to send that info to a file either.
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
- A Meteorite
- Private First Class
- Posts: 1786
- Joined: Thu Apr 28, 2005 12:56 am
- Location: California, U.S.
- Contact:
Bzfs logs everything. IP Adresses, commands used (including /set and /kill), and all conversation (including PMs to other players!!). It can even be used for bad stuff (collecting /register & /identify passwords ).Win Xp wrote:I am trying to get the following
/set
/kill
ip addresses
and all conversation
But it also logs lots of other stuff, that can be considered "useless"... it can be a headache th wade through bzfs logs.
Even better than a plugin, to have the functionality of logging built-in to bzfs! (with options on what sort of stuff you want on server startup)
Owner @ BZFX
Core Admin @ CAN
Email me: bzmet…@gmail.com
-
- Private First Class
- Posts: 1400
- Joined: Sun Feb 06, 2005 5:40 pm
- Location: Somewhere over there.
if you run bzfs from a command prompt you can just
Code: Select all
bzfs <options> >> Drive:/Path/To/File
- RPG
- Lieutenant, Junior Grade
- Posts: 2015
- Joined: Fri Sep 17, 2004 2:37 am
- Location: Chicago, Illinois
- Contact:
Masterbot
Masterbot does what you want to do. It makes logs, clean logs, with all the info. you want. And then it does it in a pretty way, so it's appealing to look at. I've attached a beta of the plugin. All it does is logs, and it will place the logs in the folder that bzfs.exe is in, with the filename set to the date that the logs were taken on. They'll look like ugly, plaintext files, because they are. I'll make a PHP script, which I'll host online, that will convert them to pretty, HTML. Right now an application does that.
Sorry if I confused you. Just try it out, ok?
Sorry if I confused you. Just try it out, ok?
- Attachments
-
- masterbot.zip
- Masterbot Beta
- (65.11 KiB) Downloaded 128 times
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
- A Meteorite
- Private First Class
- Posts: 1786
- Joined: Thu Apr 28, 2005 12:56 am
- Location: California, U.S.
- Contact:
Start BZFS using -loadplugin:oliver browne wrote:umm what into the code or -loadplugin ...
Code: Select all
bzfs -loadplugin /path/to/masterbot.dll
Owner @ BZFX
Core Admin @ CAN
Email me: bzmet…@gmail.com
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
- RPG
- Lieutenant, Junior Grade
- Posts: 2015
- Joined: Fri Sep 17, 2004 2:37 am
- Location: Chicago, Illinois
- Contact:
You have to have at 10 events in BZFS before it's written to a file. Each one of these things counts as an event: Player join, player exit, chat message, and death.oliver browne wrote:thats what i did and it dosent create the file and i thought that it might only create the file when something happend so i sent few messages and it still didnt create the file
Just do 10 of those, and it'll make the file. It does it every 10 instead of every time to keep BZFS running efficiently.
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
ow ok thanks that would explain it and it works its really cool
one more thing if you say had a server running its recording and then you shut down the server and then start it up ag ain and record dose it record to the same file if so then does it record over it (even if its ont the same day and if its not)
so really all of it...
one more thing if you say had a server running its recording and then you shut down the server and then start it up ag ain and record dose it record to the same file if so then does it record over it (even if its ont the same day and if its not)
so really all of it...
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
try this
and obvisly change the path to where ever the plugin is
Code: Select all
@echo off
set BZFSPROGRAM="C:\Program Files\BZFlag2.0.5b2\bzfs.exe"
set CONFIGFILE="C:\bzflagstuff\config.conf"
set PLUGIN="C:\bzflag\MasterBot.dll"
REM ***** Don't change anything below this line! *****
@echo on
%BZFSPROGRAM% -conf %CONFIGFILE% -plugin %PLUGIN%
pause