View Full Version : Admin logging
All the credit for this plugin goes to Bailopan for writing the code, I'm just releasing it for easy access, as the code mainly lies in the bug reporter right now.
All this does is log admin commands to separate log files based upon their steamID. Currently, only base commands (kick, ban, mapchange, etc) will utilize this, at least until the third party developers update their plugins to ulitize the LogAction logging method.
You need SM version 1385 or later for this to work!
Installation
Place admin_logging.smx in your plugins folder.
Done.
Changelog
Version 1.0 (9/4/07) Release
Extreme_One
09-04-2007, 12:32
Nice one
spelworm
09-04-2007, 13:12
very nice thank you
imported_Anth0ny
09-05-2007, 02:23
nice, thanx! =)
imported_Anth0ny
09-05-2007, 07:36
all logs will placed to /sourcemod/logs ?
Yup, they will be in the same directory as the regular sourcemod logs. If you want, you can change it in the source and recompile it (ex. sourcemod/logs/admins).
ottobohn
12-19-2007, 13:09
This mod doesn't work on the newest sourcemod 1.8x something. It fails to record. Works on older version fine.
otto
What OS? What's the exact revision? I'll check it out as soon as I get the chance..
ottobohn
12-19-2007, 17:39
Hey there,
Windows & sourcemod-r1812
Thanks!
Otto
Working on linux SM 1815 though.
ottobohn
02-01-2008, 11:22
Is it possible to write the logs to one file? I'd like to have it track when an admin logs onto the server and leaves. Is that possible?
Otto
That's beyond the scope/function of this plugin, although it would not be hard to implement yourself.
LocutusH
02-04-2008, 02:36
Any chances to get this to work again? Ive tryed it with 1812, but it didnt work on that.
I haven't had much time to look; maybe in two weeks after my finals are over.
exactly what i was looking for.
installed and is working on a windows server.
This seems to be failing a bit in DoD
Caught off Guard
05-25-2008, 09:14
hi,
is there any chance the admin logging files could go in their own folder within the logs folder so they are seperated and nice and clear.
thanks
INFINITI
06-02-2008, 08:52
Very Nice:)
Thx!
I added some code to the plugin that puts the admin's user name in the file name. Files are now named admin_name_steam.log.
This probably will not work with admins_simple.ini as it does not store an admin name.
thanks Ill be updating shortly.
i installed this and all it seems to do is to put an extra _ between admin and the steam id
new
admin__STEAM_0-1-7564545.log
old
admin_STEAM_0-1-7564545.log
i installed this and all it seems to do is to put an extra _ between admin and the steam id
new
admin__STEAM_0-1-7564545.log
old
admin_STEAM_0-1-7564545.log
Thats right, if you read the code in the plugin, its done on purpose as "Windoze" can't cope with a ':' character, so the plugin swaps it to a '-', which "Windoze" can understand.
Matt
I probably didn't explain it very well up above. it doesn't put the admins actual name, only an extra underscore and leaves the name as admin.
it should look something like this:
dann__STEAM_0-1-7564545.log
but it looks like this:
admin__STEAM_0-1-7564545.log
this is what it used to look like:
admin_STEAM_0-1-7564545.log
It doesn't do that, it creates the file based upon steam id
Matt
Electric Warrior
06-25-2008, 14:25
It doesn't do that, it creates the file based upon steam id
Matt
I think he may be refering to the custom version in post #23
That one does display the username of the admin before the Steam ID.
I probably didn't explain it very well up above. it doesn't put the admins actual name, only an extra underscore and leaves the name as admin.
it should look something like this:
dann__STEAM_0-1-7564545.log
but it looks like this:
admin__STEAM_0-1-7564545.log
this is what it used to look like:
admin_STEAM_0-1-7564545.log
It shouldn't be doing that. Are you using admins_simple.ini? GetAdminUsername() might not work work properly with that admin system. I know it works fine with SB and admins.cfg.
The format is admin_name_steam.log. The admin__steam.log is because GetAdminUsername() is returning an empty string. The admin name is supposed to go between the two underscores.
Shouldn't plugin game be all? This doesn't have any mod specific code that I know of...
I modified the version in post #23 and it now properly logs SourceMod commands run from RCON.
Tiny Tod
10-11-2009, 20:59
hey does this record all rcon commands such as if someone trying to put it in console "rcon_password XXXXXXX" like that and it shows steam id cause we had a hacker do this banned one of our guys and um i looked in the logs nuffin it was deleted or didnt even record it self i will try it out so will it record absolutly everything?? thnxs tiny tod :D
Great Biggie
11-23-2009, 20:44
getting this error, anyody know why?
L 11/23/2009 - 20:18:08: [SM] Native "GetUserAdmin" reported: Client index 0 is invalid
L 11/23/2009 - 20:18:08: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 11/23/2009 - 20:18:08: [SM] [0] Line 25, /home/groups/alliedmodders/forums/files/3/0/8/7/6/28025.attach::OnLogAction()
Great Biggie
12-11-2009, 21:44
anyone
Original version on first post works just fine. No errors running with Metamod 1.8 + Soucemod 1.2.4
getting this error, anyody know why?
L 11/23/2009 - 20:18:08: [SM] Native "GetUserAdmin" reported: Client index 0 is invalid
L 11/23/2009 - 20:18:08: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 11/23/2009 - 20:18:08: [SM] [0] Line 25, /home/groups/alliedmodders/forums/files/3/0/8/7/6/28025.attach::OnLogAction()
Use the version from post #31. That was an old bug IIRC.
Can anyone tell me why my server doesn't log admin actions? I mean, it logs some actions, but it's more like random and I dunno why.
List of my plugins:
[SM] Listing 53 plugins:
01 "Kigen's Anti-Cheat" (1.2.1.6) by CodingDirect LLC
02 "Basic Ban Commands" (1.3.5) by AlliedModders LLC
03 "Basic Comm Control" (1.3.5) by AlliedModders LLC
04 "Swap Team" (1.0.0) by raydan
05 "Player Commands" (1.3.5) by AlliedModders LLC
06 "spawntools7" (PLUGIN_VERSION) by meng
07 "Basic Votes" (1.3.5) by AlliedModders LLC
08 "Admin loggin" (1.0) by vIr-Dan
09 "Extended Mute" (1.2.2) by Twisted|Panda (Orig: FLOOR_MASTER)
10 "Fun Commands" (1.3.5) by AlliedModders LLC
11 "Sound Commands" (1.3.3) by AlliedModders LLC
12 "Advanced admin commands" (0.14) by X@IDER
13 "Knife Fight" (1.3.7) by XARiUS, Otstrel.Ru Team
14 "Weapon Restrict" (2.3.4) by Dr!fter
15 "MapChooser" (1.3.5) by AlliedModders LLC
16 "Rock The Vote" (1.3.5) by AlliedModders LLC
17 "Reserved Slots" (1.3.5) by AlliedModders LLC
18 "Hostage Down!" (1.0) by dalto
19 "Team Balance" (2.2.4) by dalto
20 "Advertisements" (0.5.5) by Tsunami
21 "Nextmap" (1.3.5) by AlliedModders LLC
22 "PsychoStats Interface Plugin Rearmed" (0.94) by Axon
23 "TeamSwitch" (1.3) by MistaGee
24 "Simple TK Manager" (1.0b) by Lebson506th
25 "Advanced c4 Countdown Timer" (1.4.1) by dalto
26 "Killer info display" (1.0) by Berni, gH0sTy
27 "Bounty" (1.2.1) by Dr!fter
28 "Spray Tracer" (5.8) by Nican132, CptMoore, Lebson506th
29 "Basic Commands" (1.3.5) by AlliedModders LLC
30 "Team Bets" (2.6) by GrimReaper - Original by ferret
31 "LastX" (1.2) by HomicidalApe
32 "QuickDefuse" (0.3) by pRED*
33 "High Ping Kicker - Lite Edition" (1.0.0.1) by Liam
34 "Admin Menu" (1.3.5) by AlliedModders LLC
35 "Headshot Only" (1.0.1) by XARiUS
36 "Admin File Reader" (1.3.5) by AlliedModders LLC
37 "KnifeMug" (2.0.0) by FlyingMongoose, sslice
38 "Extended mapconfig package" (1.0) by Milo
39 "Quake Sounds" (2.7) by dalto, Grrrrrrrrrrrrrrrrrrr, and psychonic
40 "Auto change map" (1.2) by Mleczam
41 "Fun Votes" (1.3.5) by AlliedModders LLC
42 "Basic Info Triggers" (1.3.5) by AlliedModders LLC
43 "Save Scores" (1.3.4) by exvel
44 "AFK Manager" (3.2.9) by Rothgar
45 "Map Nominations" (1.3.5) by AlliedModders LLC
46 "Anti-Flood" (1.3.5) by AlliedModders LLC
47 "RoundSound++" (1.1.0) by ANTiCHRiST
48 "Basic Chat" (1.3.5) by AlliedModders LLC
49 "Players Votes" (1.5.0) by The Resident, pZv!
50 "Admin Help" (1.3.5) by AlliedModders LLC
51 "Warmup Round" (1.1.8) by XARiUS
52 "SuperLogs: CSS" (1.2.4) by psychonic
53 "Client Preferences" (1.3.5) by AlliedModders LLC
Now it stopped working at all when I got to sm 1.3.6. Only creating file works, but it's always empty.
ya, stopped working on the 21st. no sourcemod logs... only cstrike logs now :(
I'm going to load up the admin_logging_custom and see if that works... but as of now, admin_logging is NOT working
Original version on first post works just fine. No errors running with Metamod 1.8 + Soucemod 1.2.4No errors ???
I get this errors in my log how to fix them ???
[SM] Native "GetUserAdmin" reported: Client 2 is not connected
[SM] Displaying call stack trace for plugin "admin_logging.smx":
[SM] [0] Line 23, C:\HLServer\orangebox\cstrike\addons\sourcemo d\scripting\admin_logging.sp::OnLogAction()
Error log file session closed.
rautamiekka
12-28-2010, 14:26
No errors ???
I get this errors in my log how to fix them ???
[SM] Native "GetUserAdmin" reported: Client 2 is not connected
[SM] Displaying call stack trace for plugin "admin_logging.smx":
[SM] [0] Line 23, C:\HLServer\orangebox\cstrike\addons\sourcemo d\scripting\admin_logging.sp::OnLogAction()
Error log file session closed.The Player under that number disconnected before the Plugin had finished its code. Those errors are more likely debugging info for perfection, meaning you simply ignore them.
The problem is/was
"LogMode" "map"
Simply change to
"LogMode" "daily"
and admin logging will be back.
Thanks for answer rautamiekka
If i want the plugin to write logs to logs/admin insted of logs then the only line i have to edit is line 73 to logs/admin/admin_%s_%s.log or i need to change something more before compile ?
SpazShot
02-18-2011, 00:13
EDIT: fixed issue.
Not working for me. It just creates empty log files for each steam id.
Windows
SourceMod Version: 1.3.8
SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.3.8)
SourcePawn API: v1 = 4, v2 = 3
Compiled on: Jun 25 2011 00:30:59
Build ID: 3157:cf41e7301d55
This has been working fine for me up until the latest Valve update and so the latest SM update.
Not working any more since 1.4.4
punish0r_122
07-24-2012, 14:02
any chance to get this working (maybe with webinterface ;D?)
Horsedick
07-26-2012, 23:03
Yeah doesn't appear that this works anymore ... it would be great if expanded upon but I'm not sure the creator will add to it cause its so old.
Works fine for me. Just re-compile THIS VERSION (http://forums.alliedmods.net/showpost.php?p=643348&postcount=23) under the latest stable SM.
Horsedick
07-27-2012, 15:58
Works fine for me. Just re-compile THIS VERSION (http://forums.alliedmods.net/showpost.php?p=643348&postcount=23) under the latest stable SM.
ok yeah this does appear to work, going to have to figure out a way to restrict it to target only certain steamID's and not everyone with access to SM commands or else logs will get buried or created for no reason as not everyone needs to be logged.
Horsedick
08-04-2012, 11:22
Does it work for TF2?
yeah it does but as I said it needs to have a way to restrict targeting certain steamid's or flag users vs everyone under any use of SM commands
daleGEND
08-12-2012, 19:38
Has anyone looked into these errors?
L 08/12/2012 - 19:30:12: [SM] Native "GetUserAdmin" reported: Client index -1 is invalid
L 08/12/2012 - 19:30:12: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 08/12/2012 - 19:30:12: [SM] [0] Line 25, /home/groups/alliedmodders/forums/files/3/0/8/7/6/28025.attach::OnLogAction()
L 08/12/2012 - 19:30:38: [SM] Native "GetUserAdmin" reported: Client index -1 is invalid
L 08/12/2012 - 19:30:38: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 08/12/2012 - 19:30:38: [SM] [0] Line 25, /home/groups/alliedmodders/forums/files/3/0/8/7/6/28025.attach::OnLogAction()
L 08/12/2012 - 19:30:58: [SM] Native "GetUserAdmin" reported: Client index -1 is invalid
L 08/12/2012 - 19:30:58: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 08/12/2012 - 19:30:58: [SM] [0] Line 25, /home/groups/alliedmodders/forums/files/3/0/8/7/6/28025.attach::OnLogAction()
Hello, its possible to get logs from THC RPG Plugin? can someone make it? like see who admin giving levels,credits,xp and etc
TheHardstyleBro
08-28-2012, 12:47
Has anyone looked into these errors?
Well -1 is an unconnected client. Could be rcon or console.
Powerlord
08-28-2012, 13:33
yeah it does but as I said it needs to have a way to restrict targeting certain steamid's or flag users vs everyone under any use of SM commands
The problem here is that CheckCommandAccess/CheckAccess only check users that have all the flags you specify. It's a bit trickier to add support to log commands of admins who have any of a specific list of flags.
Has anyone looked into these errors?
admin_logging_custom doesn't check if the client is -1 or 0 before attempting to get the user's admin ID. -1 and 0 are both documented client values of OnLogAction (http://docs.sourcemod.net/api/index.php?fastload=show&id=584&) when the admin is either not applicable (-1) or the server console (0), but aren't valid client IDs.
This is apparently a bug introduced into the custom version, as the version in the first post doesn't have this bug.
The fix is to split the two checks up, as attached.
daleGEND
08-28-2012, 15:02
The problem here is that CheckCommandAccess/CheckAccess only check users that have all the flags you specify. It's a bit trickier to add support to log commands of admins who have any of a specific list of flags.
admin_logging_custom doesn't check if the client is -1 or 0 before attempting to get the user's admin ID. -1 and 0 are both documented client values of OnLogAction (http://docs.sourcemod.net/api/index.php?fastload=show&id=584&) when the admin is either not applicable (-1) or the server console (0), but aren't valid client IDs.
This is apparently a bug introduced into the custom version, as the version in the first post doesn't have this bug.
The fix is to split the two checks up, as attached.
Thank you!
daleGEND
08-28-2012, 19:16
Odd, it doesn't seem to be logging anything lol.
NameUser
08-28-2012, 19:31
Odd, it doesn't seem to be logging anything lol.
Yeah, it's not working for me either...
Has anyone looked into these errors?
You're probably using an outdated version as line 25 checks if the client is > 0 before attempting to get the admin ID.
admin_logging_custom doesn't check if the client is -1 or 0 before attempting to get the user's admin ID...
Incorrect, read above.
yeah it does but as I said it needs to have a way to restrict targeting certain steamid's or flag users vs everyone under any use of SM commands
Try the attached version, it will create a sm_admin_logging.cfg file where you can set the flag(s) you want to log.
TheHardstyleBro
08-29-2012, 05:15
You're probably using an outdated version as line 25 checks if the client is > 0 before attempting to get the admin ID.
Incorrect, read above.
Try the attached version, it will create a sm_admin_logging.cfg file where you can set the flag(s) you want to log.
Thank you, works perfectly
You're probably using an outdated version as line 25 checks if the client is > 0 before attempting to get the admin ID.
Incorrect, read above.
Try the attached version, it will create a sm_admin_logging.cfg file where you can set the flag(s) you want to log.
THC_RPG Plugin q flag dosen't write anything into log like if you giving levels or credits or xp its not save into admin logs.
Horsedick
08-29-2012, 19:41
Try the attached version, it will create a sm_admin_logging.cfg file where you can set the flag(s) you want to log.
Well let me ask you this.... if you assign say "o" flags - and we know admins have access to all flags will it still pick up on Admins whom will also have this flag and if so can you set it to exclude them from getting logged?
Edit: yeah apparently it will still pick up on anyone with o flag - so looks like it would require an exception cvar.
someone can edit this https://forums.alliedmods.net/attachment.php?attachmentid=108707&d=1346228074 and add i can see logs of thc rpg admin commands like admin giving to another guy levels,credits or xp.
Does this work for CSGO?
\
Try the attached version, it will create a sm_admin_logging.cfg file where you can set the flag(s) you want to log.
I use this version, but still get this error message
L 09/03/2012 - 20:11:05: SourceMod error session started
L 09/03/2012 - 20:11:05: Info (map "gg_beacn_redux") (file "errors_20120903.log")
L 09/03/2012 - 20:11:05: [SM] Native "GetUserAdmin" reported: Client 7 is not connected
L 09/03/2012 - 20:11:05: [SM] Displaying call stack trace for plugin "admin_logging_custom.smx":
L 09/03/2012 - 20:11:05: [SM] [0] Line 36, C:\Users\Administrator\Desktop\GunGame Server\addons\sourcemod\scripting\admin_loggi ng_custom.sp::OnLogAction()
L 09/03/2012 - 20:20:04: Error log file session closed.
Is it possible to edit this plugin (http://forums.alliedmods.net/showpost.php?p=1785880&postcount=60) so it'd work with Groups?
Is it possible to edit this plugin (http://forums.alliedmods.net/showpost.php?p=1785880&postcount=60) so it'd work with Groups?
I have same question Is it possible to add q flag for thc_rpg plugin, that mean't you get admin logging when someone give to another players levels,credits,xp or giving itself.
Horsedick
09-13-2012, 10:28
I have same question Is it possible to add q flag for thc_rpg plugin, that mean't you get admin logging when someone give to another players levels,credits,xp or giving itself.
you can add a flag in overrides and this will pick it up - only big issue is being able to white list steam id's if they fall within a logged flag as it wouldn't be needed. This plugin has so much potential its just not all that great as of now.
you can add a flag in overrides and this will pick it up - only big issue is being able to white list steam id's if they fall within a logged flag as it wouldn't be needed. This plugin has so much potential its just not all that great as of now.
Like This?
Overrides
{
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 3)Command Level (for example, "changemap")
*
* You can override the default flags assigned to individual commands or command groups in this way.
* To override a group, use the "@" character before the name. Example:
* Examples:
* "@CSDM" "b" // Override the CSDM group to 'b' flag
* "csdm_enable" "bgi" // Override the csdm_enable command to 'bgi' flags
*
* Note that for overrides, order is important. In the above example, csdm_enable overwrites
* any setting that csdm_enable previously had.
*
* You can make a command completely public by using an empty flag string.
*/
"thc_rpg_level" "q" //THC_RPG Levels
}
Does this work for CSGO?
\
I tried, it didn't create any admin log folder (looked logs, logfiles, addons/sourcemod, cfg/sourcemod). Nothing.
You should look in addons/sourcemod/logs
Else check you're error logs.
You should look in addons/sourcemod/logs
Else check you're error logs.
No logs-folder in sourcemod... Where are the error logs (sorry I'm a bit newb)?
Edit: I created logs-folder in addons/sourcemod and it looks like it creates files in there. I'll let you know if it still doesn't work.
Edit2: Got it working...
I'm having a little problem with that plugin.
It seens that it's loggin even normal players when gscramble changes their team.
It creates log file with normal player steamind in name and logs that:
L 02/02/2013 - 01:41:39: [gscramble.smx] "Sathill<225><STEAM_0:0:17877426><>" has been auto-balanced to BLU.
L 02/02/2013 - 02:19:11: [gscramble.smx] "Sathill<225><STEAM_0:0:17877426><>" has been auto-balanced to RED.
sniperkills
02-02-2013, 19:29
help full plugin for admin ?
1.shows all commands that they use
2.shows every thing a admin does in my server make sure there not abuseing admin as in rcon & so on
other then change map ff off/on so on can this plugin do these things 1.-2.
similer to mani would be nice
Scipizoa
06-08-2013, 01:48
any chance this plugin will work with l4d2?c or atleast the version on post 60?
EDIT: ok and it added a weird character to the filename that windows did not like one bit heres the filename that the version on post 60 produces
admin_Ý_STEAM_0-0-0000000.log [edited steam id obv]
htcarnage
07-13-2013, 20:02
Is it possible to edit this plugin so it uses the Admins name from admins.cfg instead of (or along with) their steam id? It is very difficult to find an admins log without their name in the filename.
EDIT* Did it myself. Attached file below for anyone who wants it.
TheNewKid
07-24-2013, 04:53
Is it possible to do so it only made 1 log file per admin.?
eric0279
07-24-2013, 07:59
Is it possible to do so it only made 1 log file per admin.?
This is already (by steamid)
TheNewKid
07-24-2013, 15:28
Yes but everyday the system is made a new log file in the same folder with the same ID and the same admin.
Then I maybe have 50 files with the same admin one day..
dbmiller5
09-05-2013, 16:32
Is there any way to add the ability to log commands entered from a bind? Currently, I cannot find a mod that will log commands entered from a bind.
Can you add logging for all commands that require the basic admin flag?
Walliski
11-14-2013, 19:27
Can you add logging for all commands that require the basic admin flag?
Yeah, I'd like that aswell. There is a lot of plugins that put stuff into the logs, filtering it based on admin command, plugin or access would be nice!
It would seem this plugin creates log files and logs not just Admin activity but anyone who votes, kicks, slays, changes difficulty or mission or what ever. This leads to numerous log files being generated. This is a shame as this could be useful.
Edit: Would be better if only the activity of Admins were logged.
I will be happy if there was one who could correct this Warning in line 61
// C:\Users\Administrator\Desktop\FFA\addons\sou rcemod\scripting\admin_logging_custom.sp(61) : warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
Hunter6272
04-30-2016, 21:26
I will be happy if there was one who could correct this Warning in line 61
// C:\Users\Administrator\Desktop\FFA\addons\sou rcemod\scripting\admin_logging_custom.sp(61) : warning 234: symbol "GetClientAuthString" is marked as deprecated: Use GetClientAuthId
Use Sourcemod 1.6.3 to compile this plugin.
Ok i could do that, but why use a old version of sourcemod and not the new version 1.7 ?
hoycieto
05-20-2018, 06:38
Is this working with CS:GO?
foxhound27
12-15-2019, 14:05
converted to new syntax
Daniel Alexandru
03-20-2021, 14:30
Can someone make the plugin so it logs every command from every admin in one .txt file?
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.