Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4562479
  • 博文数量: 1214
  • 博客积分: 13195
  • 博客等级: 上将
  • 技术积分: 9105
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-19 14:41
个人简介

C++,python,热爱算法和机器学习

文章分类

全部博文(1214)

文章存档

2021年(13)

2020年(49)

2019年(14)

2018年(27)

2017年(69)

2016年(100)

2015年(106)

2014年(240)

2013年(5)

2012年(193)

2011年(155)

2010年(93)

2009年(62)

2008年(51)

2007年(37)

分类: Java

2017-11-28 16:51:16



  1. ERROR StatusLogger Unrecognized format specifier [d]
  2. ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
  3. ERROR StatusLogger Unrecognized format specifier [thread]
  4. ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
  5. ERROR StatusLogger Unrecognized format specifier [level]
  6. ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
  7. ERROR StatusLogger Unrecognized format specifier [logger]
  8. ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
  9. ERROR StatusLogger Unrecognized format specifier [msg]
  10. ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
  11. ERROR StatusLogger Unrecognized format specifier [n]
  12. ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
  13. ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
  14. ERROR StatusLogger Unrecognized format specifier [d]
  15. ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
  16. ERROR StatusLogger Unrecognized format specifier [thread]
  17. ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
  18. ERROR StatusLogger Unrecognized format specifier [level]
  19. ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
  20. ERROR StatusLogger Unrecognized format specifier [logger]
  21. ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
  22. ERROR StatusLogger Unrecognized format specifier [msg]
  23. ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
  24. ERROR StatusLogger Unrecognized format specifier [n]
  25. ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
In short, the problem arises when application classes are packaged in uber jar using maven shade plugin. While for log4j2 version 2.8.1 the fix is still pending, the suggested workaround is to update maven pom.xml with extra configuration settings for shade plugin as follow:

  1. <project xmlns=""
  2.              xmlns:xsi=""
  3.              xsi:schemaLocation=" ">

  4.         . . . . .

  5.         <build>
  6.             . . . . .
  7.             <plugins>
  8.                 . . . . .
  9.                 <plugin>
  10.                     <groupId>org.apache.maven.plugins</groupId>
  11.                     <artifactId>maven-shade-plugin</artifactId>
  12.                     <version>2.4.1</version>
  13.                     <configuration>
  14.                         <filters>
  15.                             <filter>
  16.                                 <artifact>*:*</artifact>
  17.                                 <excludes>
  18.                                     <exclude>META-INF/*.SF</exclude>
  19.                                     <exclude>META-INF/*.DSA</exclude>
  20.                                     <exclude>META-INF/*.RSA</exclude>
  21.                                 </excludes>
  22.                             </filter>
  23.                         </filters>
  24.                         <transformers>
  25.                             <transformer
  26.                                     implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer"/>
  27.                         </transformers>
  28.                     </configuration>
  29.                     <executions>
  30.                         <execution>
  31.                             <phase>package</phase>
  32.                             <goals>
  33.                                 <goal>shade</goal>
  34.                             </goals>
  35.                         </execution>
  36.                     </executions>
  37.                     <dependencies>
  38.                         <dependency>
  39.                             <groupId>com.github.edwgiz</groupId>
  40.                             <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
  41.                             <version>2.1</version>
  42.                         </dependency>
  43.                     </dependencies>
  44.                 </plugin>
  45.                 . . . . .
  46.             </plugins>
  47.         . . . . .
  48.         </build>
  49.         . . . . .
  50.         <pluginRepositories>
  51.             <pluginRepository>
  52.                 <id>oss.sonatype.org</id>
  53.                 <name>OSS Sonatype Staging</name>
  54.                 <url>https://oss.sonatype.org/content/groups/staging</url>
  55.             </pluginRepository>
  56.         </pluginRepositories>
  57.         . . . . .
  58.     </project>


阅读(7187) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~