4D v16.3

LOG EVENT

Página Inicial

 
4D v16.3
LOG EVENT

LOG EVENT 


 

LOG EVENT ( {tipoSaida ;} mensagem {; importancia} ) 
Parâmetro Tipo   Descrição
tipoSaida  Inteiro longo in Message output type
mensagem  String in Contents of the message
importancia  Inteiro longo in Message’s importance level

The LOG EVENT command sets up a customized system for recording internal events that occur during the use of your application.

Pass the custom information to be noted according to the event in message.

The optional outputType parameter specifies the output channel taken by the message. You can pass one of the following constants, located in the "Log Events" theme, in this parameter:

Constant Type Value Comment
Into 4D commands log Longint 3 Indicates to 4D to record the message in the 4D commands log file, if this file has been activated. The 4D commands log file can be enabled using the SET DATABASE PARAMETER command (selector 34).
Note: 4D log files are grouped together in the Logs folder, which is created next to the database structure file (see the Get 4D folder command).
Into 4D debug message Longint 1 Indicates to 4D to send the message to the system debugging environment. The result depends on the platform:
Into 4D diagnostic log Longint 5 Indicates to 4D to record the message in the 4D diagnostic file, if this file has been enabled.
The diagnostic log file can be enabled using the SET DATABASE PARAMETER command (selector 79).
Into 4D request log Longint 2 Indicates to 4D to record the message in the 4D requests log, if this file has been activated
Into Windows log events Longint 0 Indicates to 4D to send the message to the “Log events” of Windows. This log receives and stores messages coming from running applications. In this case, you can attribute a level of importance to message via the optional importance parameter (see below).
Notes:

  • For this feature to be available, the Windows Log Events service must be running.
  • Under Mac OS, the command does nothing with this output type

If you do not pass the outputType parameter, the value 0 (Into Windows log events) is used by default.

If you have defined the outputType parameter as Into Windows log events, you can attribute a level of importance to message, via the optional importance parameter which helps you to read and understand the log events. There are three levels of importance: Information, Warning, and Error.
4D provides you with the following predefined constants, placed in the “Log Events” category:

Constant Type Value
Error message Longint 2
Information message Longint 0
Warning message Longint 1

If you don’t pass anything in importance or pass an incorrect value, the default value (0) is used.

Exemplo  

Caso queiras realizar um seguimento das aberturas de sua base baixo Windows, pode escrever a seguinte linha de código no Método de base On Startup:

 LOG EVENT(Into Windows log events;"Abertura da base Fatoração.")

Cada vez que se abre o banco de dados, esta informação será escrita no visor de eventos de Windows e seu nível de importância será 0.



Ver também 

SET DATABASE PARAMETER

 
PROPRIEDADES 

Produto: 4D
Tema: Ambiente de Sistema
Número 667

Comportamento específico sob Mac OSComportamento específico sob Windows

 
HISTÓRIA 

Modificado: 4D v11 SQL Release 2
Modificado: 4D v13

 
ARTICLE USAGE

Manual de linguagem 4D ( 4D v16)
Manual de linguagem 4D ( 4D v16.1)
Manual de linguagem 4D ( 4D v16.2)
Manual de linguagem 4D ( 4D v16.3)