The existing Logger plugin should be working just fine. If there is a specific feature you are looking for (all of what you mentioned already exists in it), please request it in the plugin's thread.
Solved Command logging
Discussion in 'Plugin Requests' started by Upperking, May 17, 2015.
-
Wulf Community Admin
-
Is there any way to save the log / TPR made on the server?
Who teleported requests and to whom. -
I have looked but didnt find anything. Im looking for logs that i will see in chat if a admin uses any command like /vanish or /god. It would also be great if i can get if they spawn in something through f1. I need it only broadcasted to auth2 though. Is there anything atleast alike? Or anyone who can make this? For spawning through F1 im using AdminSpawn plugin so its not broadcasted to everyone.
-
Wulf Community Admin
For console logging, Logger for Rust | Oxide. I'll likely add chat command logging eventually.
-
All players in my game see the logger in chat. How can i make it so only i do. I have authlevel set to 2. Nobody else is auth2
[DOUBLEPOST=1454983313][/DOUBLEPOST]Its also only shows the commands that i use not my mods -
Wulf Community Admin
-
-
Wulf Community Admin
-
Its possible to log the commands and its outputs on oxide?
For example, I want to use the plugin locations, and when I type /loc I want a log with all the locations that the plugin outputs in the chat. -
So for example, that "Location" plugin you mentioned has two different functions, one to display your location, and another to display everyone's location.
The class PlayerPosition() is the one that displays your location
Code:void PlayerPosition(PlayerSession session) => hurt.SendChatMessage(session, prefix, GetLocation(session)); string GetLocation(PlayerSession session) => session.WorldPlayerEntity.transform.position.ToString(); static string prefix = "<color=#ff8000>Position</color>: ";
Code:PlayerPosition(PlayerSession session) => hurt.SendChatMessage(session, "<color=#ff8000>Position</color>: "+session.WorldPlayerEntity.transform.position.ToString());
Code:string LocLog = session.Name+" position: "+session.WorldPlayerEntity.transform.position.ToString();
The first, and easy way to log the command being used would be just to output the command to the console whenever it was executed, you can use Puts(); to send messages to the console. So for this case you can useCode:Puts(LocLog);
The second method would be to log every time someone uses the command to a list, like I do in the Reporting plugin for logging the chat. All you need to do is create a simple string list (string means just normal messages) You can make a simple list, lets call it CommandLog by usingCode:List<string> CommandLog = new List<string>();
Code:CommandLog.Add(LocLog);
So now we have added the message to a list, we need to save the list, we use Oxide's data handler for that. You need to supply two things, A location and filename, the variable name. Our variable name is what our list is called. (CommandLog) the location and filename can be whatever you want, but lets go ahead and call it LocLogs for simplicity, in the Location directory (The name of the plugin we're using as an example). We can also use it as a class statement, called Save. Which makes it look neater and is easier to use. So the Save would look like this:Code:void Save() => Interface.GetMod().DataFileSystem.WriteObject("Location/LocLogs", CommandLog);
Code:void PlayerPosition(PlayerSession session) { hurt.SendChatMessage(session, "<color=#ff8000>Position</color>: "+session.WorldPlayerEntity.transform.position.ToString()); string LocLog = session.Name+" position: "+session.WorldPlayerEntity.transform.position.ToString(); Puts(LocLog); }
Code:List<string> CommandLog = new List<string>(); void Save() => Interface.GetMod().DataFileSystem.WriteObject("Location/LocLogs", CommandLog);void PlayerPosition(PlayerSession session) { hurt.SendChatMessage(session, "<color=#ff8000>Position</color>: "+session.WorldPlayerEntity.transform.position.ToString()); string LocLog = session.Name+" position: "+session.WorldPlayerEntity.transform.position.ToString(); CommandLog.Add(LocLog); Save(); }
To Load the file you can use:Code:void Loaded() => CommandLog = Interface.GetMod().DataFileSystem.ReadObject<List<string>>("Location/LocLogs");
So feel free to have a mess around with any of the plugins you use, you can even point them to the same folder and make a folder called CommandLogs or something, then call the file name what the plugin is called, or the command that they use, so it puts them all neatly into one place.
Feel free to ask questions, I and I'm sure many others here, will be glad to help you -
Log al /commands in a file Is that possible?
Command Logger for Reign of Kings | Oxide -
Is there a plugin that will logged the commands that enter players?
Example /help, /kit etc. -
Wulf Community Admin
The Logger plugin.
-
-
Wulf Community Admin
-
Or try plugin Spyon and edit config, it will gona make log o used commands, just dont forget to read overwiev so you have good set up
-
-
Request a module, you can record the use of G command GM brush items on the day
希望可以实现一个记录GM刷物品的记录,当然如果可以记录所有命令的日志最好 -
Hello guys, someone can make plugin like Command Logger for Reign of Kings made by @Mughisi
Thanks all -
Hi, does anyone know where can I find in FTP txt log or file with commands what have been written in game console? Probably I check all folders and I didn't find it.