本文整理汇总了Java中org.apache.logging.log4j.core.config.Configurator.setRootLevel方法的典型用法代码示例。如果您正苦于以下问题:Java Configurator.setRootLevel方法的具体用法?Java Configurator.setRootLevel怎么用?Java Configurator.setRootLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.logging.log4j.core.config.Configurator
的用法示例。
在下文中一共展示了Configurator.setRootLevel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyDelegate
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Override
public void applyDelegate(Config config) {
Security.addProvider(new BouncyCastleProvider());
if (isDebug()) {
setLogLevel(Level.DEBUG);
}
Configurator.setRootLevel(getLogLevel());
Configurator.setAllLevels("de.rub.nds.modifiablevariable", Level.FATAL);
if (getLogLevel() == Level.ALL) {
Configurator.setAllLevels("de.rub.nds.tlsattacker.core", Level.ALL);
Configurator.setAllLevels("de.rub.nds.tlsattacker.transport", Level.DEBUG);
} else if (getLogLevel() == Level.TRACE) {
Configurator.setAllLevels("de.rub.nds.tlsattacker.core", Level.DEBUG);
Configurator.setAllLevels("de.rub.nds.tlsattacker.transport", Level.DEBUG);
} else {
Configurator.setAllLevels("de.rub.nds.tlsattacker.core", Level.OFF);
}
LOGGER.debug("Using the following security providers");
for (Provider p : Security.getProviders()) {
LOGGER.debug("Provider {}, version, {}", p.getName(), p.getVersion());
}
// remove stupid Oracle JDK security restriction (otherwise, it is not
// possible to use strong crypto with Oracle JDK)
UnlimitedStrengthEnabler.enable();
}
示例2: configLog
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
public static void configLog(){
try {
String mavenLog = System.getProperty( MAVEN_LOG_LEVEL );
if ( mavenLog != null ){
Configurator.setAllLevels(
"com.formulasearchengine.mathosphere.pomlp.convertor.POMConverter",
Level.getLevel(mavenLog)
);
Configurator.setRootLevel(Level.getLevel(mavenLog));
}
} catch ( Exception e ){
LOG.trace("No log level specified by maven. DebugMSG: " + e.getMessage() );
}
}
示例3: debugChangeRootLevel
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Test
public void debugChangeRootLevel() {
logger.debug("Debug message 1");
final List<LogEvent> events = app.getEvents();
assertEventCount(events, 1);
Configurator.setRootLevel(Level.OFF);
logger.debug("Debug message 2");
assertEventCount(events, 1);
Configurator.setRootLevel(Level.DEBUG);
logger.debug("Debug message 3");
assertEventCount(events, 2);
}
示例4: testPrepareProtocolMessageContents
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
/**
* Test of prepareProtocolMessageContents method, of class
* TokenbindingMessagePreparator.
*
* @throws java.lang.Exception
*/
@Test
public void testPrepareProtocolMessageContents() throws Exception {
preparator.prepare();
Configurator.setRootLevel(Level.ALL);
Serializer serializer = new TokenBindingMessageSerializer(message, ProtocolVersion.TLS12);
byte[] serialize = serializer.serialize();
TokenBindingMessageParser selfParser = new TokenBindingMessageParser(0, serialize, ProtocolVersion.TLS12);
TokenBindingMessage selfParsed = selfParser.parse();
assertNotNull(selfParsed);
String base64 = "AIkAAgBBQM9eQES_uxoyRn0DDoYLcWqvm6Oo3p0lI1s3fRjdIj6dw8wLDf0RWkxuyNAmgAQkUWxm8_JfwS8MziBYVuJ5ECcAQHF_HGcPiSv_X60y5Ql-AxoqaWzwqXvpStEBgY_IX8kT_qAHsb5h38ZuQoWOaZVgqlF1sa70B4GVXxmi2JkdJYcAAA";
byte[] decode = Base64.getUrlDecoder().decode(base64);
TokenBindingMessageParser parser = new TokenBindingMessageParser(0, decode, ProtocolVersion.TLS12);
TokenBindingMessage parsedMessage = parser.parse();
byte[] xBytes = new byte[32];
System.arraycopy(parsedMessage.getPoint().getValue(), 0, xBytes, 0, 32);
System.out.println("X:" + ArrayConverter.bytesToHexString(xBytes));
byte[] yBytes = new byte[32];
System.arraycopy(parsedMessage.getPoint().getValue(), 32, yBytes, 0, 32);
System.out.println("Y:" + ArrayConverter.bytesToHexString(yBytes));
BigInteger intX = new BigInteger(xBytes);
System.out.println("intx: " + intX);
ASN1Integer x = new ASN1Integer(xBytes);
System.out.println("xasn1:" + x.getPositiveValue());
ASN1Integer y = new ASN1Integer(yBytes);
ECDomainParameters generateEcParameters = generateEcParameters();
ECPublicKeyParameters ecPublicKeyParameters = new ECPublicKeyParameters(generateEcParameters.getCurve()
.createPoint(x.getPositiveValue(), y.getPositiveValue()), generateEcParameters);
System.out.println("RAW X:" + ecPublicKeyParameters.getQ().getRawXCoord().toBigInteger());
System.out.println("RAW Y:" + ecPublicKeyParameters.getQ().getRawYCoord().toBigInteger());
System.out.println("Valid: " + ecPublicKeyParameters.getQ().isValid());
ECDSASigner signer = new ECDSASigner();
signer.init(false, ecPublicKeyParameters);
byte[] signedContent = ArrayConverter
.hexStringToByteArray("0002A5F86D4EA32D7B305774F6EA56DB444F4D70D777ABF77B810561935F3A96B9C2");// Correct
// ekm
// with
// blablub
// ours byte[] signedContent =
// ArrayConverter.hexStringToByteArray("00022054736C9903E145286A925F9F2C064603D3211BCF0D81EDB6FEB6E9ACCAB4B7");
byte[] rBytes = new byte[32];
System.arraycopy(parsedMessage.getSignature().getValue(), 0, rBytes, 0, 32);
byte[] sBytes = new byte[32];
System.arraycopy(parsedMessage.getSignature().getValue(), 32, sBytes, 0, 32);
System.out.println("r:" + ArrayConverter.bytesToHexString(rBytes));
System.out.println("s:" + ArrayConverter.bytesToHexString(sBytes));
System.out.println("r:" + new ASN1Integer(rBytes).getPositiveValue());
System.out.println("s:" + new ASN1Integer(sBytes).getPositiveValue());
System.out.println(signer.verifySignature(signedContent, new ASN1Integer(rBytes).getPositiveValue(),
new ASN1Integer(sBytes).getPositiveValue()));
// decodeASN1(parsedMessage.getSignature().getValue());
}
示例5: before
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Before
public void before() {
Configurator.setRootLevel(Level.OFF);
}
示例6: after
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@After
public void after() {
Configurator.setRootLevel(Level.INFO);
}
示例7: before
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Before
public void before() {
Configurator.setRootLevel(Level.ERROR);
Configurator.setLevel("io.linuxserver", Level.ERROR);
}
示例8: setup
import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Before
public void setup() {
Configurator.setRootLevel(Level.DEBUG);
}