I recently started working on logstash. I am running it in docker and I want to read its logs using 'docker logs <container_name>' command. But I am getting error
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAuthCache).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
My dockerfile is as below, please let me know how to configure log4j using dockerfile.
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list && \
rm -rf /var/lib/apt/lists/* && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y --force-yes install sudo wget logrotate texinfo build-essential openjdk-7-jdk ant git zip && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install logstash package
RUN wget --quiet https://download.elastic.co/logstash/logstash/packages/debian/logstash_2.3.0-1_all.deb && \
dpkg -i ./logstash_2.3.0-1_all.deb && \
rm ./logstash_2.3.0-1_all.deb
ENV PATH /opt/logstash/bin:$PATH
CMD ["/usr/bin/sudo", "-E", "-u", "logstash", "/opt/logstash/bin/logstash", "-f", "/etc/logstash/logstash.conf"]
EXPOSE 5000-5100/tcp 5000-5100/udp
# Config ls
ENV LS_HEAP_SIZE 12288M
ADD logstash.conf /etc/logstash/logstash.conf
# Configuring log4j
ADD log4j.properties /etc/logstash/config/log4j.properties