Logging using @Loggable jcabi annotations trims logs

I annotate my @Loggable jcabi annotation function. The statement that it registers is not complete, it truncates the line and just prints .. for truncated data. I want the whole line to be printed. This can be done using this annotation.

@Loggable(Loggable.DEBUG)
public String load(URL url) {
  return url.openConnection().getContent();
}

Produces the following magazine

[DEBUG] #load('http://www.google.com'): returned "<html ..." in 23ms

Log4j.properties

# Root logger option
log4j.rootLogger=INFO, file, CONSOLE

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=swami-plugin.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n


log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=com.jcabi.log.MulticolorLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%color{%-5p}] %c: %m%n
+5
source share
1 answer

This is by design. @Loggableannotations are produced by the method of the method and the result object, using their methods toString()up to 100 characters long. Basically, to keep log lines short enough to fit into the system log and similar systems.

, , :

@Loggable(trim = false)
public String load(URL url) {

github.

+1

All Articles