Solved Changing the Bukkit console logging level

Discussion in 'Plugin Development' started by !Phoenix!, Dec 21, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    !Phoenix!

    Hi,

    Up to now I've always made use of a custom logging.properties file to output all Messages from my plugin (From SEVERE to FINEST) to the console.

    server-start.bat (open)
    Code:
    @ECHO OFF
    SET BINDIR=%~dp0
    CD /D "%BINDIR%"
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xincgc -Xmx1G -jar -Djava.util.logging.config.file="logging.properties" "craftbukkit-1.4.5-R1.0.jar"
    
    logging.properties (open)
    Code:
    ############################################################
    #      Global properties
    ############################################################
     
    # Default global logging level.
    # This specifies which kinds of events are logged across
    # all loggers.  For any given facility this global level
    # can be overriden by a facility specific level
    # Note that the ConsoleHandler also has a separate level
    # setting to limit messages printed to the console.
    .level= INFO
     
     
     
    ############################################################
    # Handler specific properties.
    # Describes specific configuration info for Handlers.
    ############################################################
     
    # Limits the message that are printed on the console. Bukkit default is INFO.
    org.bukkit.craftbukkit.util.TerminalConsoleHandler.level = ALL
     
     
     
    ############################################################
    # Facility specific properties.
    # Provides extra control for each logger.
    ############################################################
     
    # Default Bukkit logger
    Minecraft.level = INFO
     
    # RegionForSale
    Minecraft.RegionForSale.level = FINE


    But now, all of a sudden, this isn't working anymore. Even when I set the global .level option to ALL it has no effects.
    Can anyone please tell me how to get my messages back?

    It's working with 1.4.5-R0.2, but not 1.4.5-R1.0
    The messages are still written to the bukkit-log-file.


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Solution:

    Since CraftBukkit 1.4.5-R0.3 the TerminalConsoleHandler has moved into a subdirectory representing the current minecraft-version

    Handler location:

    #Build-number
    #2511 and everything before: org.bukkit.craftbukkit.util.TerminalConsoleHandler
    #2512: An unimportant step in between
    #2513: org.bukkit.craftbukkit.v1_4_5.util.TerminalConsoleHandler
    #2513 and everything after: org.bukkit.craftbukkit.v[MC_VERSION].util.TerminalConsoleHandler

    To receive messages < level INFO address the TerminalConsoleHandler in your logging.properties file and set it's level to ALL or whatever you want. Since CraftBukkit build #2513 it's located in a subfolder with the name of the corresponding minecraft-version. Dots (.) are replaced by underscores (_).

    My new logging.properties (open)
    Code:
    ############################################################
    #      Global properties
    ############################################################
     
    # Default global logging level.
    # This specifies which kinds of events are logged across
    # all loggers.  For any given facility this global level
    # can be overriden by a facility specific level
    # Note that the ConsoleHandler also has a separate level
    # setting to limit messages printed to the console.
    .level= INFO
     
     
     
    ############################################################
    # Handler specific properties.
    # Describes specific configuration info for Handlers.
    ############################################################
     
    # Limits the message that are printed on the console. Bukkit default is INFO.
    org.bukkit.craftbukkit.util.TerminalConsoleHandler.level = ALL
    org.bukkit.craftbukkit.v1_4_5.util.TerminalConsoleHandler.level = ALL
    org.bukkit.craftbukkit.v1_4_6.util.TerminalConsoleHandler.level = ALL
     
     
     
    ############################################################
    # Facility specific properties.
    # Provides extra control for each logger.
    ############################################################
     
    # Default Bukkit logger
    Minecraft.level = INFO
     
    # RegionForSale
    Minecraft.RegionForSale.level = FINE


    TnT, md_5

    Can one of you tell me what was recently changed concerning the console-output of plugins?

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

    fireblast709

    Try adding a filter and set it to finest there
     
  3. Offline

    gomeow

    Don't just tag mods...
     
  4. Offline

    !Phoenix!

    fireblast709
    PHP:
    logger.setFilter(new Filter() {
        @
    Override
        
    public boolean isLoggable(LogRecord record) {
            return 
    true;
        }
    });
    has no effect :(

    gomeow
    Okay, sorry for that. Is there another way to ask the mods directly? I'm not really sure if they have/take the time to look trough all the threads.
     
  5. Offline

    fireblast709

    Code:java
    1. logger.setFilter(new Filter() {
    2. @Override
    3. public boolean isLoggable(LogRecord record) {
    4. record.setLevel(Level.FINEST);
    5. return true;
    6. }
    7. });
    Because you did not edit the level ;D
     
  6. Offline

    !Phoenix!

    Why should I?

    But however, even by setting the level in the method it doesn't work either.
    Did you tried it yourself? -> Is it working for you?
     
  7. Offline

    fireblast709

    Well it works for me if I set the filter on Logger.getLogger("Minecraft"), and only for the main logger, no the plugin loggers (or you would have to set it)
     
  8. Offline

    !Phoenix!

    Using the main logger doesn't work for me as well.. But it would have taken the possibility to differentiate between the loggers anyway.

    Using a workaround like a debug-setting isn't an option for me at the moment, because technically that's exactly the purpose of logging-levels.

    It would be really nice to hear a developer about this, because like I said using any version up to 1.4.5-R0.2 works perfectly fine.
     
  9. Offline

    !Phoenix!

    Okay, I've got it:
    The terminal console handler moved between craftbukkit-1.4.5-R0.2 and craftbukkit-1.4.5-R1.0 from org.bukkit.craftbukkit.util.TerminalConsoleHandler to org.bukkit.craftbukkit.v1_4_5.util.TerminalConsoleHandler.
    Updating the reference in the logging.properties will fix the issue.

    Notice: The directory is currently changing with every new minecraft-version and, according to Amaranth, it's unlikely that this will change in the future.
     
Thread Status:
Not open for further replies.

Share This Page