Customization
DiscordLog allows you to customize what events will be logged, and the log messages themselves. This page shows how to change them!
To customize logged events, you should add or remove items from the logged-events list. Commenting out the lines that you don't want will also work. You can find the list of all available events here.
logged-events:
- player-join
- player-disconnect
This configuration will only log players connecting and disconnecting from the server
logged-events:
# Commenting out the stuff that you don't want also works
# - player-command-execution
# - console-command-execution
# - player-join
# - player-disconnect
# - player-kick
- player-death
# - player-respawn
- player-kill-entity
- player-kill-named-entity
This configuration will only log players killing entities and dying themselves
logged-events:
- player-command-execution
- console-command-execution
- player-join
- player-disconnect
- player-kick
- player-death
- player-respawn
- player-kill-entity
- player-kill-named-entity
This configuration will log everything
Log messages can also be customized. They can have embedded arguments, and use discord-specific formatting.
To change a log message, change the text of it in the messages
section.
Example
messages:
player-command: "Someone just sent a command." # The default is "Player **#{player}** executed the command ``#{command}``"
Format | Syntax | Result |
---|---|---|
Bold | **Bold text** |
|
Italic | _Italic text_ |
|
Underline | __Underlined text__ |
|
Strikethrough | ~~Strikethrough~~ |
|
Spoiler | ||Spoiler|| |
|
Blockquote | > Quote |
|
Inline code | `/say hello` |
Example
messages:
player-command: "**Someone just sent a command in bold.**"
Embedded arguments are a way to insert context-specific text into a message. The syntax for embedding an argument is #{<argument name>}
.
For example a message defined in the config as this
messages:
player-command: "Player **#{player}** executed the command ``#{command}``"
could result in one of the following messages (depending on the command executed and player sending the command)
Warning
The backtick (
`
) is an escape character in parameters (eg.`#{param}
will render as#{param}
, whereas#{param}
would show the value of param). If you want to use the discord inline code formatting syntax, you have to use a double backtick (``
). The syntax for a parameter wrapped in inline code would be``#{param}``
Log messages can also use Discord emojis, for example:
messages:
player-command: ":desktop: Player **#{player}** executed the command ``#{command}``"
If you want to use a server-specific emoji, do this:
- Select the emoji from the emoji panel
- Add a backslash (
\
) before the emoji - Send the message (it should look something like this:
<:barrier:12345678901234567>
) - Copy the resulting message and paste it into your config
The resulting config would be:
messages:
player-command: "<:barrier:12345678901234567> Player **#{player}** executed the command ``#{command}``"