{"action":"closed","issue":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/375","repository_url":"https://api.github.com/repos/testcontainers/testcontainers-java","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/375/labels{/name}","comments_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/375/comments","events_url":"https://api.github.com/repos/testcontainers/testcontainers-java/issues/375/events","html_url":"https://github.com/testcontainers/testcontainers-java/issues/375","id":236962011,"number":375,"title":"NullPointerException using logger org.slf4j:slf4j-log4j12:jar:1.7.21 with testcontainers","user":{"login":"IrishkA13","id":6481763,"avatar_url":"https://avatars0.githubusercontent.com/u/6481763?v=3","gravatar_id":"","url":"https://api.github.com/users/IrishkA13","html_url":"https://github.com/IrishkA13","followers_url":"https://api.github.com/users/IrishkA13/followers","following_url":"https://api.github.com/users/IrishkA13/following{/other_user}","gists_url":"https://api.github.com/users/IrishkA13/gists{/gist_id}","starred_url":"https://api.github.com/users/IrishkA13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IrishkA13/subscriptions","organizations_url":"https://api.github.com/users/IrishkA13/orgs","repos_url":"https://api.github.com/users/IrishkA13/repos","events_url":"https://api.github.com/users/IrishkA13/events{/privacy}","received_events_url":"https://api.github.com/users/IrishkA13/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/testcontainers/testcontainers-java/milestones/25","html_url":"https://github.com/testcontainers/testcontainers-java/milestone/25","labels_url":"https://api.github.com/repos/testcontainers/testcontainers-java/milestones/25/labels","id":2575379,"number":25,"title":"1.3.1","description":"","creator":{"login":"bsideup","id":1050762,"avatar_url":"https://avatars0.githubusercontent.com/u/1050762?v=3","gravatar_id":"","url":"https://api.github.com/users/bsideup","html_url":"https://github.com/bsideup","followers_url":"https://api.github.com/users/bsideup/followers","following_url":"https://api.github.com/users/bsideup/following{/other_user}","gists_url":"https://api.github.com/users/bsideup/gists{/gist_id}","starred_url":"https://api.github.com/users/bsideup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsideup/subscriptions","organizations_url":"https://api.github.com/users/bsideup/orgs","repos_url":"https://api.github.com/users/bsideup/repos","events_url":"https://api.github.com/users/bsideup/events{/privacy}","received_events_url":"https://api.github.com/users/bsideup/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":12,"state":"open","created_at":"2017-06-10T17:23:57Z","updated_at":"2017-06-23T08:30:30Z","due_on":"2017-06-20T07:00:00Z","closed_at":null},"comments":2,"created_at":"2017-06-19T17:21:52Z","updated_at":"2017-06-23T08:30:30Z","closed_at":"2017-06-23T08:30:30Z","body":"From testcontainers documentation:\r\n`Testcontainers, and many of the libraries it uses, utilize slf4j for logging. In order to see logs from Testcontainers, your project should include an SLF4J implementation (Logback is recommended). `\r\n\r\nI expect testcontainers to support **org.slf4j.slf4j-log4j12**\r\nThe next NullPointerException appears:\r\n\r\n```\r\nCaused by: java.lang.NullPointerException\r\n\tat java.util.Hashtable.put(Hashtable.java:459)\r\n\tat org.apache.log4j.MDC.put0(MDC.java:150)\r\n\tat org.apache.log4j.MDC.put(MDC.java:85)\r\n\tat org.slf4j.impl.Log4jMDCAdapter.put(Log4jMDCAdapter.java:60)\r\n\tat org.slf4j.MDC.put(MDC.java:116)\r\n\tat org.testcontainers.utility.AuditLogger.doLog(AuditLogger.java:34)\r\n\tat org.testcontainers.dockerclient.AuditLoggingDockerClient.lambda$startContainerCmd$3(AuditLoggingDockerClient.java:43)\r\n\tat org.testcontainers.dockerclient.AuditLoggingDockerClient.lambda$wrappedCommand$14(AuditLoggingDockerClient.java:102)\r\n\tat com.sun.proxy.$Proxy20.exec(Unknown Source)\r\n\tat org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:201)\r\n\t... 18 more\r\n```\r\n\r\nAuditLoggingDockerClient (for commands START,REMOVE,STOP,KILL,CREATE_NETWORK,REMOVE_NETWORK) has call like this:\r\n\r\n```\r\n(cmd, e) -> doLog(\"START\", null, containerId, cmd, e));\r\n\r\ndoLog(String action, String image, String containerId, DockerCmd<?> cmd, @Nullable Exception e)\r\n```\r\n\r\nSo image = null. \r\norg.slf4j.impl.Log4jMDCAdapter uses Hashtable where therev is a check for value != null during call 'put'. So NullPointerException occurs. \r\n\r\nPossible fix is to use image=\"\" instead of image=null"}}
{"actor":{"display_login":"bsideup"}}