当前位置: 首页>>代码示例>>Java>>正文


Java Configurator.setRootLevel方法代码示例

本文整理汇总了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();
}
 
开发者ID:RUB-NDS,项目名称:TLS-Attacker,代码行数:27,代码来源:GeneralAttackDelegate.java

示例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() );
    }
}
 
开发者ID:ag-gipp,项目名称:mathosphere,代码行数:15,代码来源:LoggingConfig.java

示例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);
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:13,代码来源:LoggerTest.java

示例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());
}
 
开发者ID:RUB-NDS,项目名称:TLS-Attacker,代码行数:60,代码来源:TokenbindingMessagePreparatorTest.java

示例5: before

import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Before
public void before() {
    Configurator.setRootLevel(Level.OFF);
}
 
开发者ID:RUB-NDS,项目名称:TLS-Attacker,代码行数:5,代码来源:UnknownMessageParserStressTest.java

示例6: after

import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@After
public void after() {
    Configurator.setRootLevel(Level.INFO);
}
 
开发者ID:RUB-NDS,项目名称:TLS-Attacker,代码行数:5,代码来源:UnknownMessageParserStressTest.java

示例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);
}
 
开发者ID:linuxserver,项目名称:davos,代码行数:6,代码来源:Logging.java

示例8: setup

import org.apache.logging.log4j.core.config.Configurator; //导入方法依赖的package包/类
@Before
public void setup() {
    Configurator.setRootLevel(Level.DEBUG);
}
 
开发者ID:MichaelJ2,项目名称:big-buum-man,代码行数:5,代码来源:TestServer.java


注:本文中的org.apache.logging.log4j.core.config.Configurator.setRootLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。