log_to_file vs log_amx
Ok, I'm trying to write to a log file. I have sucessfully done that that using the following code:
Code:
What I'm trying to do is get the file to a specific folder above the server folder. Code:
In mysearch to find an answer on the forums, I have found out that amxx doesn't want us to use log_to_file anymore and say to use log_amx. Well, that doesn't even give an option for a different file. Is there any way to write to a log file the preceeds the server in its path??? (If anyone is wondering, I run 5 servers and I would like to log every ban that my admins do to 1 location vs having to check each server's log.) |
You could always try the ../ trick and see if it works.
|
Re: log_to_file vs log_amx
Baka Inu, all things that write and read to files starts in the base folder.
so "addons/text.ini" puts it into the addons folder of the mod running. |
Twilight Suzuka, please use only English insults in this forum.
|
Err, well log_to_file works a tad differently ;]
If you specify no path information, it logs into the logs folder. If you have a "/" or "\\" char anywhere, it then builds a path relative to the mod dir. Then you can use the .. trick to go up one directory. |
Thanks for the help. I got the ../ to work. here is an example for others that might want to do the same thing.
Code:
My Directory setup is: Code:
c:/servers/hlserverns/ns/addons/amxmodx/log/Code:
c:/servers/bans/admin.txt(this could be used as part of a plugin that will allow a banlist to be shared throughout all your servers if you run multiple servers on 1 machine.) Thanks again, SilverSquirrl |
Re: log_to_file vs log_amx
../../ doesnt work on my linux machine. Is the slash syntax right in the linux too?
i have /usr/local/games/CS/HLDS/cstrike/addons/amxmodx/logs -default folder i have /usr/local/games/CS/logs folder and use format(directory, 99, "../../../../../logs/%s",hostname) if (!dir_exists(directory)) mkdir(directory) doesnt work (hostname IS RIGHT i am sure) |
Re: log_to_file vs log_amx
"../../logs/%s"
|
Re: log_to_file vs log_amx
Quote:
|
| All times are GMT -4. The time now is 14:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.