Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log file not working with compose #1141

Open
ben-gineer opened this issue Dec 17, 2018 · 1 comment
Open

Log file not working with compose #1141

ben-gineer opened this issue Dec 17, 2018 · 1 comment

Comments

@ben-gineer
Copy link

Description

I'm unable to persist any logs when using the compose form of configuration.

Here's my compose:

version: "2"
services:
  mysql:
    image: myproduct.com/mysql:${datalayerversion}
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=1234
xo-management-service:
    image: myproduct.com/xo-management-service:${projectversion}
    ports:
      - "8093:8093"
    links:
      - mysql
    environment:
      - loglevel=debug
      - dbtype=MYSQL
      - dbclass=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      - dbhost=mysql
      - dbname=cd_broker_discovery_db
      - dbuser=root
      - dbpassword=1234
      - dbport=3306
      - service=xo-management-service
    container_name: "xo-management-service"

Here's my pom:

<plugin>
                        <groupId>io.fabric8</groupId>
                        <artifactId>docker-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>start-test-containers</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-test-containers</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <logStdout>true</logStdout>
                            <logDate>default</logDate>
                            <verbose>true</verbose>
                            <images>
                                <image>
                                    <alias>xo-management-service</alias>
                                    <external>
                                        <ignoreBuild>true</ignoreBuild>
                                        <type>compose</type>
                                    </external>
                                    <run>
                                        <wait>
                                            <http>
                                                <url>http://${docker.host.address}:8093/health</url>
                                                <method>GET</method>
                                                <status>200</status>
                                            </http>
                                            <time>180000</time>
                                        </wait>
                                        <log>
                                            <enabled>true</enabled>
                                            <color>yellow</color>
                                            <file>${project.build.directory}/container.log</file>
                                            <driver>
                                                <name>json-file</name>
                                            </driver>
                                        </log>
                                    </run>
                                </image>
                            </images>
                            <imagePullPolicy>IfNotPresent</imagePullPolicy>
                        </configuration>
                    </plugin>

I've tried various combinations of the log file and driver options, but I'm not able to see any generated log files. The console output gets generated correctly.

Should the log setting work with compose files?

Info

  • d-m-p version : 0.26.1
  • Maven version (mvn -v) : 3.6.0
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T19:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.6.0/libexec
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.1", arch: "x86_64", family: "mac"
  • Docker version : Engine: 18.09.0
@dordnung
Copy link

dordnung commented Feb 7, 2020

I can confirm this.

Without <external> logging to a file works fine, but when adding <external> for compose it stops working. Also <color> doesn't seem to work with compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants