Official Content

Configures how much detail has to be added to the log of the standard classes at runtime. In addition to the specified level, all the levels of detail that follow in descending order will be included.

Values

0. Off The OFF Level has the highest possible rank and is intended to turn off logging. This is the default value.
1. Fatal The FATAL Level designates very severe error events that will presumably lead the application to abort.
2. Error The ERROR Level designates error events that might still allow the application to continue running.
3. Warn The WARN Level designates potentially harmful situations.
4. Info The INFO Level designates informational messages that highlight the progress of the application at coarse-grained level.
5. Debug The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
6. All The ALL Level has the lowest possible rank and is intended to turn on all logging.

Scope

Generators: .NET, .NET Framework, Java
Level: Generator

Description

The Log level property allows indicating from which level (from the number you indicate downwards) you want to include details in the log file. So, in addition to the specified level, all the levels of detail that follow in descending order will be included.

For example, if you choose "4. Info", the log will contain: 4. Info, 3. Warn, 2. Error and 1. Fatal messages.

When using the .NET Generator and having the Log output property set to 'Console' or 'File', the Log level property modifies the values of the <log4net threshold=...> tag of the Log.config and Log.Console.Config files. Additionally, it sets the <trace enabled=... /> tag of the Web.Config file. These config files can be found in the web applications folder.

Tip: The log.config file is referenced by web.config (<log4net configSource="log.config"/>) and is used when running the web app. Log.Console.config file is referenced by Client.exe.config and is used for command line executions. For further information, check Log4net configuration in GeneXus .Net application.

When using the Java Generator, this property modifies the values of the <loggers=...> tag of the log4j.xml file. The log4j2.xml file can be found in the <webapp>\WEB-INF\classes folder.

The Log Level can also be set by defining an environment variable. See Log settings with environment variables.

Advanced configuration

To modify or extend log parameters, you can change values on the following templates:

  • rollingfile.console.config which goes to the log.console.config file used in command-line programs.
  • rollingfile.web.config which goes to the log.config file used in the web application.

Files are located in "GeneXusInstallFolder"\Log\Java\RollingFile and "GeneXusInstallFolder"\Log\Dotnet\RollingFile

To generate a log file for every day, change the template as follows:

 <appender  name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file  value="./"/>
      <appendToFile  value="true"/>
      <maximumFileSize  value="9000KB"/>
      <maxSizeRollBackups  value="0"/>
      <rollingStyle  value="Date"/>
      <staticLogFileName value="false" />
      <datePattern value="dd.MM.yyyy'.log'" />
      <layout  type="log4net.Layout.PatternLayout">
         <conversionPattern value="%d [%t] %-5p %c - %m%n" />
      </layout>
      <lockingModel  type="log4net.Appender.FileAppender+MinimalLock"/>
</appender>

Runtime/Design time

This property applies only at design time.

How to apply changes

To apply the corresponding changes when the property value is configured, Build any object.

See Also

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant