You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2021/03/16 03:07:00 UTC

[jira] [Commented] (LOG4J2-3045) DOCKER_URI Value for log4j docker lookup

    [ https://issues.apache.org/jira/browse/LOG4J2-3045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17302185#comment-17302185 ] 

Ralph Goers commented on LOG4J2-3045:
-------------------------------------

It has been a while since I worked with the docker module. However, when I tested it I was using the Log4j Spring Cloud Config Client's sample application which is configured as [https://github.com/apache/logging-log4j2/blob/release-2.x/log4j-spring-cloud-config/log4j-spring-cloud-config-samples/log4j-spring-cloud-config-sample-application/docker/docker-compose.yml.] When I tested I had it use socat to access the Docker APis. All the reading I did seemed to indicate going directly to the unix.socket was not a good idea.

I started my app with "DOCKER_URI=http://socat:1234".  After looking at the DockerLookup it seems I never implemented support for the unix socket. It only supports http at the moment.

> DOCKER_URI Value for log4j docker lookup
> ----------------------------------------
>
>                 Key: LOG4J2-3045
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3045
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Configuration
>    Affects Versions: 2.14.1
>            Reporter: Scott Selvia
>            Priority: Minor
>
> I've been trying to use the docker lookup to log the container id and name; I've set the DOCKER_URI to various values including [unix:///var/run/docker.sock]  and [http://localhost.|http://localhost./]  The following curl command has worked perfectly (curl --unix-socket /var/run/docker.sock http:/localhost/containers/json)  I mounted the location to the docker.sock to the container -> /var/run/docker.sock:/var/run/docker.sock.  I've stepped through the docker lookup method either the creation of the URL is not correct or when set to [http://localhost|http://localhost/] or tcp://localhost:2375 I'm getting an access error.
>  
> What is the correct value of the DOCKER_URI in order for the docker lookup method to pull the content for the container?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)