[ADMIN] CustomLog 0.20 - Create customized log file [935]

Discussion in 'Inactive/Unsupported Plugins' started by fritzwalter, Mar 27, 2011.

  1. Offline

    fritzwalter

    CustomLog - Create a customized log file:
    Version: v0.20

    Requests: request1 and request2


    Custom Log hooks events from bukkit and makes you able to log them. YOU decide which events should be loged and how, it's possible to define templates with keywords to design your own logfile.

    A short example:
    The template: "[[DATE]] [playerNAME] joined the server"
    Will write this logfile: "[27.03.2011 18:32:55] fritzwalter joined the server"

    But if you want, you can define templates that are much more complex.

    The list of keywords and all hooked events would be to long to write down all here in this thread, so i wrote a README.txt and put an example config.yml in the zip file.

    Now with multiple logfile support:
    -create as many configuration files in the configuration dir (e.g. "1.yml","2.yml" ....).
    That means u can define 1 config-file for the chat 1 for commands and so on,everyone will create a logfile.

    The readme is might not be easy to understand beceause I'm not a native english speaker, so if you have questions ,ask me and I will help you.

    Installation:
    Just put the CustomLog.jar in your plugin folder.

    Basic configuration:

    basic configuration pack
    This zip file contains 3 basic configurations:
    -Chatlogger
    -Comandlogger
    -login/out logger

    If you have ideas for more basic configurations let me now, i will add them.



    Features:
    • hooks playerevents
    • hooks blockevents
    • hooks entityevents
    • use templates
    Download:CustomLog0.20


    old Versions (open)


    ToDo:
    • programm an easy config file editor
    • splittable logs(daily,weekly....)
    • log single commands(e.g for iconomy transactions)
    Bugreports:

    Thanks for the reports, but to fix bugs, i need following from you:
    • CustomLog config.yml
    • CustomLog log file
    • server log file
    Changelog:


    Version 0.20:
    • updated to work with bukkit version 818
    • multiple logfile support
    • deleted keyword [playerITEMINHANDold](use [playerITEMINHAND] instead)
    • added keyword [playerITEMINHANDnew]
    Version 0.13:

    • updated to work with craftbukkit 612
    • keywords [useDirection] and [clickDIRECTION] were both renamed to [DIRECTION]
    • keyword [blockDAMAGELEVEL] removed
    Version 0.12:

    • fixed nullpointer bug in PLAYERlogins event
    Version 0.11:

    • added keyword [playerIP] to the group/object player
    Version 0.1:

    • Initial Release
     
    sukosevato likes this.
  2. Offline

    Direct1221

    Thank you. :) I like this ALOT :D
     
  3. Offline

    Kevin Forte

    Much more complex* (A message from your neighborhood grammar nazi) :) This looks awesome! Can't wait to test it out.
     
  4. Offline

    Direct1221

    Any way I can get IP on Joins to be added to the logs as well?
     
  5. Offline

    fritzwalter

    UPDATE
    -added the keyword [playerIP]

    Direct, i added this..

    Thanks Kevin, i hope it's right now. ;)
     
  6. Offline

    Direct1221

    Thank you! <3

    1000 internetz to you! :D

    I get errors now! :(

    CraftBukkit Build 556
    Custom Log 0.11

    Code:
    08:01:51 [SEVERE] Could not pass event PLAYER_LOGIN to CustomLog
    java.lang.NullPointerException
            at org.bukkit.craftbukkit.entity.CraftPlayer.getAddress(CraftPlayer.java:44)
            at com.de.fritzwalter.CustomLog.LogLine.parseLogline(LogLine.java:157)
            at com.de.fritzwalter.CustomLog.LogLine.parseLogline(LogLine.java:246)
            at com.de.fritzwalter.CustomLog.CustomLogPlayerListener.onPlayerLogin(CustomLogPlayerListener.java:76)
            at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:207)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
            at net.minecraft.server.ServerConfigurationManager.a(ServerConfigurationManager.java:143)
            at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:76)
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:68)
            at net.minecraft.server.Packet1Login.a(SourceFile:46)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:34)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:87)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  7. Offline

    Raph55

    With the config, i have this error in the log file :
    error: keyvalues size is not similar to keywords size [playerNAME]
     
  8. Offline

    fritzwalter

    UPDATE
    -fixed nullpointer bug in PLAYERlogins event

    Direct, the bug is fixed..
    and
    Raph55, like i wrote you, i need your logs and the config to fix this.
     
    Direct1221 likes this.
  9. Offline

    Direct1221

    Thanks @fritzwalter will install now, and will report feedback.

    Works Swimmingly!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  10. Offline

    Raph55

    Yes it works, thanks !
     
  11. Offline

    Dragoboss

    In your ToDo list u say multiple log files, would there be a option where you could define a file/path for every different log command if you'd like to?
     
  12. Offline

    fritzwalter

    hi,

    do you mean for example the chat is loged in chat.txt and all commands in commands.txt(i would do it like this)

    or like giveCommand.txt , spawnCommand.txt .....

    UPDATE

    -works now with craftbukkit 612

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  13. Offline

    Wolfy9247

    Here's from the console:
    Code:
    [19:32:00] [SERVERE] Nag author: '<NoAuthorGiven>' of 'CustomLog' about the following: onPlayerJoin has been replaced with a new signature, <PlayerJoinEvent>
    
     
  14. Offline

    fritzwalter

    thanks for that report... i'll fix that in the next version
     
  15. Offline

    dortan

    I need to know if a Chest is opened and What are the items movement inside of it. there are tones of griefer control but few of them log theif actions. Can You do this ?
     
  16. Offline

    Dragoboss

    @fritzwalter sorry for not reacting to your last answer...
    I meant like your first example mostly, just like every join is logged appart from the commands etc.
    The more configurable it would be the better.

    I'm really glad you made this plugin because its so lightweight and even though it logs so much...
     
  17. Offline

    Wolfy9247

    Do you have an estimate of when you'll be releasing the next version? It's still not fixed as of this version and it's popped up a lot since then when I reported it so it's just a bother to have logging all the time. It'd be appreciated, thanks!
     
  18. Offline

    jmcneely

    Wonderful plugin, I absolutely love it. One small thing however, when someone logs in I get this message:

    14:20:20 [SEVERE] Nag author: '<NoAuthorGiven>' of 'CustomLog' about the followi
    ng: onPlayerJoin has been replaced with a new signature, (PlayerJoinEvent)
     
  19. Offline

    1lann

    Is there going to be 733 support?
     
  20. Offline

    Plague

    considered inactive
     
  21. Offline

    1lann

    Hmm I should have mentioned it earlier... this works with 733, I tested it myself but I'm not sure about 740 since I haven't tested it with that.
     
  22. Offline

    fritzwalter

    hey guys,

    sorry for not reacting for so long time on this thread......
    i work now on making this plugin running with the newest bukkit version and i will implement the promissed features.
     
    1lann likes this.
  23. Offline

    fritzwalter

    UPDATE

    -works now with bukkit 818
    -added multiple logfile support

    @Dragboss
    the multiple logfile support is now like in my first example (one file for chat one for command....).
    You need to 2 config files (e.g. "chat.yml" and "commands.yml") in the one for the chat just activate chat logging and in the one for commands avtivate the command logging. (dont' forget to define different logfile pathes)

    @ moderator: can you move this thread to plugin releases again?
     
  24. Offline

    iorunner

    So with .20 and Bukkit 860, logs to log files other than log.txt only get written to the other log file during a plugin reload or server restart. Is that intentional?
     
  25. Offline

    Dr Danco

    just what i needed!
    havent seen any problems (cb 860)

    Thanks :)
     
  26. Offline

    fritzwalter

    @iorunner
    I think that is because of the internal buffer, look in the configuration, the standart is 10. That means the events will be written in the internal buffer and when it is filled, the buffer will be written to log file. Maybe you didn't filled the buffer completely in your tests, it would be nice if you could try this out. That the buffer is written to log when the plugin shuts down(plugin or server restart) is intenional because the buffer is maybe just half filled.

    @all
    The plugin should work properly with cb 860, but i will do some tests later....
     
  27. Offline

    iorunner

    Fritzwalter, thank you very much for the clarification.
     
  28. Offline

    FCHatred

    Hey, Fritzwalter I seem to have a problem with this plugin. I want it to only log player messages so I set that value to true and every time I start up the server I get this error

    Code:
    148 recipes
    16 achievements
    18:22:33 [INFO] Starting minecraft server version Beta 1.6.6
    18:22:33 [INFO] Loading properties
    18:22:33 [INFO] Starting Minecraft server on *:3662
    18:22:33 [WARNING] **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    18:22:33 [WARNING] The server will make no attempt to authenticate usernames. Be
    ware.
    18:22:33 [WARNING] While this makes the game possible to play without internet a
    ccess, it also opens up the ability for hackers to connect with any username the
    y choose.
    18:22:33 [WARNING] To change this, set "online-mode" to "true" in the server.set
    tings file.
    18:22:33 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-823-
    gb9d0b04-b860jnks (MC: 1.6.6)
    18:22:33 [INFO] Preparing level "orly"
    18:22:33 [INFO] Preparing start region for level 0
    18:22:33 [INFO] Preparing start region for level 1
    18:22:34 [INFO] Preparing spawn area: 48%
    18:22:34 [INFO] Load Configuration file: config.yml
    18:22:34 [SEVERE] Could not load 'plugins\CustomLog.jar' in folder 'plugins':
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:172)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:194)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:117)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: mapping values are not allowed here
     in "<reader>", line 4, column 58:
         ... rue        PLAYERitemheldchanges: false
                                             ^
    
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:74
    5)
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.ja
    va:307)
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:18
    3)
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Par
    serImpl.java:564)
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :228)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :230)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :230)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:12
    2)
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCons
    tructor.java:124)
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
            at org.bukkit.util.config.Configuration.load(Configuration.java:82)
            at com.de.fritzwalter.CustomLog.ConfigurationVars.loadConfig(Configurati
    onVars.java:86)
            at com.de.fritzwalter.CustomLog.ConfigurationVars.<init>(ConfigurationVa
    rs.java:81)
            at com.de.fritzwalter.CustomLog.LogWriter.<init>(LogWriter.java:24)
            at com.de.fritzwalter.CustomLog.ConfigManager.<init>(ConfigManager.java:
    21)
            at com.de.fritzwalter.CustomLog.CustomLog.<init>(CustomLog.java:16)
            ... 13 more
    18:22:34 [WARNING] [AutoSave] UNKNOWN SERVER VERSION: It has NOT been tested and
     AutoSave MAY NOT function properly: git-Bukkit-0.0.0-823-gb9d0b04-b860jnks (MC:
     1.6.6)
    18:22:34 [INFO] [AutoSave] Loading config file
    18:22:34 [INFO] [AutoSave] Version 1.3.0 is enabled: 263b3413-d976-4bc3-8085-c8c
    0b565477b
    18:22:34 [INFO] SimpleSave: Parts of config file are blank, but not null. Possib
    le errors might happen.
    18:22:34 [INFO] SimpleSave: DON'T! Post this 'warning' on the thread.
    18:22:34 [INFO] SimpleSave: 3.13 Initialized
    18:22:34 [INFO] [SuperPowers] Couldn't find permissions plugin. Defaulting to op
    s.txt
    18:22:34 [INFO] SuperPowers v0.8 loaded!
    18:22:34 [INFO] WorldEdit 4.6 enabled.
    18:22:34 [INFO] WorldEdit: No known permissions plugin detected. Using configura
    tion file for permissions.
    18:22:34 [INFO] WorldGuard: No known permissions plugin detected. Using configur
    ation file for permissions.
    18:22:34 [WARNING] Unknown option 'option1' in blacklist.txt for 'option1=messag
    e'
    18:22:34 [INFO] WorldGuard: Blacklist loaded.
    18:22:34 [INFO] WorldGuard: (orly) Single session is enforced.
    18:22:34 [INFO] WorldGuard: (orly) TNT ignition is PERMITTED.
    18:22:34 [INFO] WorldGuard: (orly) Lighters are PERMITTED.
    18:22:34 [INFO] WorldGuard: (orly) Lava fire is blocked.
    18:22:34 [INFO] WorldGuard: (orly) All fire spread is disabled.
    18:22:34 [INFO] WorldGuard: Loaded configuration for world 'orly"
    18:22:34 [INFO] WorldGuard: (orly_nether) Single session is enforced.
    18:22:34 [INFO] WorldGuard: (orly_nether) TNT ignition is PERMITTED.
    18:22:34 [INFO] WorldGuard: (orly_nether) Lighters are PERMITTED.
    18:22:34 [INFO] WorldGuard: (orly_nether) Lava fire is blocked.
    18:22:34 [INFO] WorldGuard: (orly_nether) Fire spread is UNRESTRICTED.
    18:22:34 [INFO] WorldGuard: Loaded configuration for world 'orly_nether"
    18:22:34 [INFO] WorldGuard 5.0-alpha10 enabled.
    18:22:34 [INFO] Done (0.180s)! For help, type "help" or "?"
    18:23:11 [INFO] spongesbitch [/192.168.1.8:52510] logged in with entity id 0 at
    ([ orly] -46.49448115384517, 64.0, 164.2448604849298)
    18:23:11 [INFO] SimpleSave: Current save interval is 10 minute(s)
    18:23:11 [INFO] SimpleSave: Current backup interval is 15 minute(s)
    18:23:11 [INFO] [AutoSave] AutoSaveThread Started: Interval is 300 seconds, Warn
     Times are 0
    18:24:12 [INFO] <spongesbitch> gga
    
    Any idea how to fix that?
     
  29. Offline

    arsjet

    Daily logs to split them.
     
  30. Offline

    fritzwalter

    @FCHatred hi, it seems that you have an error in your config file. All hooks that can be loged are by default false, so you just need to set that ones to true you want to have loged. This is for example the easiest way to hook player messages:
    Code:
    enabling:
        player:
            PLAYERmessages: true
    templates:
        player:
            PLAYERmessagesTemplate: '[[DATE]] [playerNAME]: [chatMESSAGE]'
    general:
        buffersize: 10
        LogFilePath: plugins/logger/log.txt
    
    @arsjet Thanks, good idea, i think i will implement that.
     

Share This Page