The Logback 1.1.3 LayoutWrappingEncoder documentation doesn\'t indicate what the default charset will be if the user doesn\'t set it, but the source code says:
The system's default charset is determined by Java and set in the system property file.encoding
, but this property can also be specified as the JVM starts up (more in this answer). Eclipse, Netbeans, Maven, etc. can use this system property to set the default charset to UTF-8 and that is probably why output is in UTF-8 even though you did not specify it.
To remove the element of chance, specify the character set for logging as shown in this answer. Logback's source code shows how the character set is used to convert the Strings to bytes to write to file in the convertToBytes method (more on Strings to bytes is explained in this answer).
On Unix, the value for file.encoding
is determined using the environment variables (e.g. via LANG=en_US.UTF-8
as explained here, but other environment variables can be involved as well).
On Windows, the default code page is shown with the command chcp
. The code page number corresponds with a character set shown in this list. For example, code page 65001 corresponds with UTF-8. The default locale is shown with the command systeminfo | findstr Locale
.
In short: once your software leaves your development environment, you cannot assume any specific default character set. Therefore, always specify a character set.