By uber jar, do you mean an all-in-one flat jar, or do you mean a jar of jars like spring boot artifacts?
On 4 May 2016 at 14:43, Julian Keppel <[email protected]> wrote: > Hi everyone, > > I tested the flume appender for log4j2. My configuration XML looks like > this: > > <Configuration status="ERROR" name="some_name"> > > ... > > <Appenders> > > ... > > <Flume name="FLUME" compress="true"> > <Agent host="${FLUME_HOST}" port="${FLUME_PORT}"/> > <PatternLayout pattern="${LOG_PATTERN}"/> > <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/> > </Flume> > </Appenders> > > <Loggers> > <Root level="DEBUG"> > <AppenderRef ref="FLUME"/> > ... > </Root> > </Loggers> > </Configuration> > > And I build my application with maven assembly plugin to get an uber jar > which contains all dependencies (I want to ship a single jar file to all > the destination runtime environments). > > When I start the application I get the following error: > ERROR Error processing element Flume ([Appenders: null]): CLASS_NOT_FOUND > > So it looks like there is some dependency missing. But in the official doc > I read that for remote mode of the flume appender I only need the following > dependency (including the necessary log4j dependencies): > > <dependencies> > > ... > > <dependency> > <groupId>org.apache.logging.log4j</groupId> > <artifactId>log4j-core</artifactId> > <version>2.5</version> > </dependency> > <dependency> > <groupId>org.apache.logging.log4j</groupId> > <artifactId>log4j-api</artifactId> > <version>2.5</version> > </dependency> > <dependency> > <groupId>org.apache.logging.log4j</groupId> > <artifactId>*log4j-flume-ng*</artifactId> > <version>2.5</version> > </dependency> > </dependencies> > > Another hint: When I start the application from eclipse, it seems to work > totally fine (at least I don't get the error from above). > > So what I am doing wrong here? Has anyone some advice for me? Thanks in > advance. > > Julian > -- Matt Sicker <[email protected]>
