Skip to content

Logging to servlet in different docker image #19

Open
@Mindtoeye

Description

@Mindtoeye

I have a FluentD docker image running your plugin and I have a docker image that runs a Wildfly microservice listening on port 8081. I'm trying to forward from the FluentD plugin to my servlet but the gem doesn't seem to use or resolve docker-compose network names properly. In my docker-compose file I have a service defined called 'logservice'. That service is configured with:

services:
  logservice:
    networks:
      - lognet

Then my network is configured as:

networks:
  lognet:
    driver: bridge

Other services can now contact docker images using the service name but the FluentD plugin doesn't work that way. I've tried the following configurations:

<match application.ags.**>
  type http
  endpoint_url    http://localhost.local:8081/logservice
  ...
<match application.ags.**>
  type http
  endpoint_url    http://logservice.local:8081/logservice
  ...
<match application.ags.**>
  type http
  endpoint_url    http://logservice:8081/logservice
  ...

I think (but am not sure) that I've fixed the name resolution part but the services are still not talking to each other. Forgot to add the actual console output for the configuration:

endpoint_url http://logservice:8081/logservice

I get the following output:

fluentd| 2017-04-19 13:16:46 +0000 [warn]: Net::HTTP.Put raises exception: Errno::ECONNREFUSED, 'Failed to open TCP connection to logservice:8081 (Connection refused - connect(2) for "logservice" port 8081)'

Any idea what might be going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions