Rechercher dans le manuel MySQL

5.4.2.2 Default Error Log Destination Configuration

This section discusses which server options configure the default error log destination, which can be the console or a named file. It also indicates which log writer components base their own output destination on the default destination.

In this discussion, console means stderr, the standard error output. This is your terminal or console window unless the standard error output has been redirected to a different destination.

The server interprets options that determine the default error log destination somewhat differently for Windows and Unix systems. Be sure to configure the destination using the information appropriate to your platform:

After the server interprets the default error log destination options, it sets the log_error system variable to indicate the default destination, which affects where several log writer components write error messages. See How the Default Error Log Destination Affects Log Writers.

Default Error Log Destination on Windows

On Windows, mysqld uses the --log-error, --pid-file, and --console options to determine whether the default error log destination is the console or a file, and, if a file, the file name:

  • If --console is given, the default destination is the console. (--console takes precedence over --log-error if both are given, and the following items regarding --log-error do not apply.)

  • If --log-error is not given, or is given without naming a file, the default destination is a file named host_name.err in the data directory, unless the --pid-file option is specified. In that case, the file name is the PID file base name with a suffix of .err in the data directory.

  • If --log-error is given to name a file, the default destination is that file (with an .err suffix added if the name has no suffix), located under the data directory unless an absolute path name is given to specify a different location.

If the default error log destination is the console, the server sets the log_error system variable to stderr. Otherwise, the default destination is a file and the server sets log_error to the file name.

Inhoudsopgave Haut

Default Error Log Destination on Unix and Unix-Like Systems

On Unix and Unix-like systems, mysqld uses the --log-error option to determine whether the default error log destination is the console or a file, and, if a file, the file name:

  • If --log-error is not given, the default destination is the console.

  • If --log-error is given without naming a file, the default destination is a file named host_name.err in the data directory.

  • If --log-error is given to name a file, the default destination is that file (with an .err suffix added if the name has no suffix), located under the data directory unless an absolute path name is given to specify a different location.

  • If --log-error is given in an option file in a [mysqld], [server], or [mysqld_safe] section, mysqld_safe finds and uses the option, and passes it to mysqld.

Note

It is common for Yum or APT package installations to configure an error log file location under /var/log with an option like log-error=/var/log/mysqld.log in a server configuration file. Removing the file name from the option causes the host_name.err file in the data directory to be used.

If the default error log destination is the console, the server sets the log_error system variable to stderr. Otherwise, the default destination is a file and the server sets log_error to the file name.

Inhoudsopgave Haut

How the Default Error Log Destination Affects Log Writers

After the server interprets the error log destination configuration options, it sets the log_error system variable to indicate the default error log destination. Log writer components may base their own output destination on the log_error value, or determine their destination independently of log_error

If log_error is stderr, the default error log destination is the console, and log writers that base their output destination on the default destination also write to the console:

  • log_sink_internal, log_sink_json, log_sink_test: These writers write to the console. This is true even for writers such as log_sink_json that can be enabled multiple times; all instances write to the console.

  • log_sink_syseventlog: This writer writes to the system log, regardless of the log_error value.

If log_error is not stderr, the default error log destination is a file and log_error indicates the file name. Log writers that base their output destination on the default destination base output file naming on that file name. (A writer might use exactly that name, or it might use some variant thereof.) Suppose that the log_error value file_name. Then log writers use the name like this:

  • log_sink_internal, log_sink_test: These writers write to file_name.

  • log_sink_json: Successive instances of this writer named in the log_error_services value write to files named file_name plus a numbered .NN.json suffix: file_name.00.json, file_name.01.json, and so forth.

  • log_sink_syseventlog: This writer writes to the system log, regardless of the log_error value.


Zoek in de MySQL-handleiding

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-error-log-destination-configuration.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:en Manuel MySQL : https://dev.mysql.com/

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut