2017-08-28 34 views
0

我使用SLF4J登錄信息,用火花和scala.How我可以顯示用戶插入的LOGG不整的火花日誌文件消息中插入的,這裏是log4j.properties只顯示記錄由用戶

# 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 
什麼是火花

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] 
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 

這裏scalla代碼

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

任何幫助瓦特表示

這裏例如應該感激

回答

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

請檢查更新,我用同樣的你,日誌中的信息較少,但仍然是無用的信息 –