[
https://issues.apache.org/jira/browse/LOG4J2-2433?focusedWorklogId=178051&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-178051
]
ASF GitHub Bot logged work on LOG4J2-2433:
------------------------------------------
Author: ASF GitHub Bot
Created on: 21/Dec/18 17:14
Start Date: 21/Dec/18 17:14
Worklog Time Spent: 10m
Work Description: jvz commented on a change in pull request #8:
LOG4J2-2433 Coroutines Support
URL: https://github.com/apache/logging-log4j-kotlin/pull/8#discussion_r243640779
##########
File path:
log4j-api-kotlin/src/main/kotlin/org/apache/logging/log4j/kotlin/ThreadContextContext.kt
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.kotlin
+
+import kotlinx.coroutines.ThreadContextElement
+import org.apache.logging.log4j.ThreadContext
+import kotlin.coroutines.AbstractCoroutineContextElement
+import kotlin.coroutines.CoroutineContext
+
+
+/**
+ * The value of [ThreadContext] map and stack.
+ * See [ThreadContext.getImmutableContext] and
[ThreadContext.getImmutableStack].
+ */
+public data class ThreadContextContents(
Review comment:
Then maybe this can be named `ThreadContextData`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 178051)
Time Spent: 0.5h (was: 20m)
> Support MDCs with Kotlin coroutines
> -----------------------------------
>
> Key: LOG4J2-2433
> URL: https://issues.apache.org/jira/browse/LOG4J2-2433
> Project: Log4j 2
> Issue Type: New Feature
> Components: Kotlin API
> Affects Versions: Kotlin 1.0.0
> Reporter: Raman Gupta
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Create support for log4j2 MDC when used with Kotlin coroutines. Since
> coroutines do not guarantee which underlying thread is executing code after a
> continuation, a standard ThreadLocal is not sufficient to keep the MDC
> context.
> Kotlin coroutines have a mechanism by which "coroutine local" data can be
> stored. See the reference implementation for SLF4J here:
> https://github.com/Kotlin/kotlinx.coroutines/tree/master/integration/kotlinx-coroutines-slf4j
> We should implement an optional native module to add support for log4j2 MDC
> using the same pattern, that does not require having SLF4J and the
> slf4j-log4j2 implementation on the classpath.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)