Solved How Can I Prevent The Console From Logging Certain Commands?

Discussion in 'Plugin Development' started by SnowGears, Jul 6, 2013.

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

    SnowGears

    I have a server where players login by typing "/login <password>".
    How can I disable Bukkit from logging "Player issued server command /login <theirPassword>"?
    Thanks in advance.
     
  2. Offline

    CubieX

    We don't give support for servers with "online-mode = false" here. Sorry.
     
    Rprrr likes this.
  3. Offline

    Jozeth

    You mustn't assume it's offline. The server could just use that plugin because he likes the idea of it.
     
    MasterDoctor, russjr08, Cirno and 3 others like this.
  4. Offline

    ZeusAllMighty11

    I believe there is an option in the Bukkit.yml which involves logging. Setting it to the lowest setting possible would fix this, but may also remove other messages. (such as plugins who use the logger's "info" method)
     
  5. Offline

    Rprrr

    He likes the idea of cracked servers? Right.
     
  6. Offline

    SnowGears

    You as in who? This is development question. Why assume anything here?
    We are all developers and this is a development question. If you want me to rephrase it I can but I will still implement it however the hell I want.
    Here is my new question since my old one was not good enough for your help.
    How can I prevent a server from logging commands to the console?

    Thank you. I will try this and let you know.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
    MasterDoctor and xTrollxDudex like this.
  7. Offline

    Ivan

    Rprrr there is a chance he's using it for website authentication, like I do?
     
    MasterDoctor and Jozeth like this.
  8. Offline

    SnowGears

    So do you know a way I can do this?

    I just checked and I cant find this option anywhere.

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

    ZeusAllMighty11

    The idea of having a login system... Doesn't have to be cracked. You're just full of yourself today.
     
    MasterDoctor, Minnymin3 and Jozeth like this.
  10. Offline

    Pawnguy7

  11. Offline

    Jozeth

    Rprrr
    *Late reply*
    Not all servers that use a plugin that has a login system are cracked. My friend had a similar plugin on his server and it wasn't 'offline'.
    AuthMe is a plugin that has a login system and has 2% of server that are online and the rest are offline - This doesn't really help but it shows not all server that use a login system are cracked.

    Also these people have a point because I am currently making a plugin for my own server which will use a login system to link the forums to the server and have in-game rewards for forum achievements. Whilst the server is 'online'.
     
  12. add a filter to the bukkit logger that filters contains " issued server command /login "
     
  13. Offline

    jayfella

    The console hooks into the logger. The logger logs everything that occurs. The only way to modify what is and isnt displayed in the console is by setting the "Level" of logging to display. You can alter it so that only "Level.WARNING" and above is displayed, etc. That's how it works. As far as I am aware, you cannot "omit" lines from being displayed unless you specifically create an environment to do so (i.e. alter or create a plugin).
     
  14. Offline

    SnowGears

    Solved. Did this if anyone is curious.
    (This is in my OnEnable() method)

    Code:java
    1.  
    2. Filter f = new Filter(){
    3. public boolean isLoggable(LogRecord line) {
    4. if (line.getMessage().contains("/login") || line.getMessage().contains("/register") || line.getMessage().contains("pass")) {
    5. returnfalse;
    6. }
    7. returntrue;
    8. }
    9.  
    10. public String doFilter(String arg0) {
    11. returnnull;
    12. }
    13.  
    14. public String doFilterUrl(String arg0) {
    15. returnnull;
    16. }};
    17.  
    18.  
    19. log.setFilter(f);
    20.  
     
  15. Offline

    Hoolean

    Tooner101

    Just optimising/shortening your method:
    Code:java
    1. public hoolean isLoggable(LogRecord line) {
    2. return !(line.getMessage().contains("/login") || line.getMessage().contains("/register") || line.getMessage().contains("pass"))
    3. }
     
    Tooner101 likes this.
  16. Offline

    jayfella

    Hoolean maybe use .startsWith() instead of .contains() - to stop somebody putting "/login" at the end to avoid a potential situation being logged.
     
  17. Offline

    SnowGears

    You could but its not like the users or anyone else will even know that the console doesnt log certain phrases.
     
  18. Offline

    Hoolean

    jayfella Tooner101

    True, always a good precaution. Additionally, make everything lowercase first; I think it may be logged as /LOGIN if a user types it in such a manner :p
     
    Tooner101 likes this.
  19. Offline

    SnowGears

    Oh ya. Thats what I forgot to do. In any case, its working in the way I want to it to right now. I just have to put that extra check in there.
     
Thread Status:
Not open for further replies.

Share This Page