2017-08-28 4 views
0

j'utilise slf4j pour enregistrer des informations, en utilisant étincelle et scala.How puis-je afficher un message inséré par l'utilisateur comme logg pas l'ensemble du fichier journal d'allumage, voici log4j.propertiesAfficher uniquement logger inséré par l'utilisateur

# Here we have defined root logger 
log4j.rootLogger=ALL,R 


#Direct log messages to file 
log4j.appender.R=org.apache.log4j.RollingFileAppender 
log4j.appender.R.File=./logging.log 
log4j.appender.R.layout=org.apache.log4j.PatternLayout 
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L- %m%n 

et ici par exemple de ce qui est montré par étincelle

2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.numHeapArenas: 16 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.numDirectArenas: 16 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.pageSize: 8192 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.maxOrder: 11 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.chunkSize: 16777216 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.tinyCacheSize: 512 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.smallCacheSize: 256 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.normalCacheSize: 64 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.maxCachedBufferCapacity: 32768 
2017-08-29 09:19:03 DEBUG PooledByteBufAllocator:76- -Dio.netty.allocator.cacheTrimInterval: 8192 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected]556 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 TRACE NioEventLoop:46- Instrumented an optimized java.util.Set into: [email protected] 
2017-08-29 09:19:03 DEBUG ThreadLocalRandom:71- -Dio.netty.initialSeedUniquifier: 0x7436749e963a1485 (took 1 ms) 
2017-08-29 09:19:03 DEBUG ByteBufUtil:76- -Dio.netty.allocator.type: unpooled 
2017-08-29 09:19:03 DEBUG ByteBufUtil:76- -Dio.netty.t 

i want to see only message inserted by user 

Voici le code scalla

import org.apache.log4j.{Level, Logger} 
Logger.getLogger("org").setLevel(Level.OFF) 

Toute aide w ould être apprécié

Répondre

0
import org.apache.log4j.{Level, Logger} 
Logger.getLogger("org").setLevel(Level.OFF) 
+1

s'il vous plaît vérifier la mise à jour, j'ai utilisé la même chose que vous, il y a moins d'informations dans le journal, mais toujours des informations inutiles –