Questions tagged [threadcontext]

45 questions
0
votes
1 answer

Log4j2 migration - how to pass username param to appender in every LoggingEvent / LogEvent

I need to get a username parameter to my ConsoleAppender in every LoggingEvent (or LogEvent in log4j2). How can I recreate this implementation of altering the doAppend method of my CustomConsoleAppender in log4j when migrating to log4j2: public…
user17913034
0
votes
1 answer

How to use RequestContext custom attributes of armeria in log4j2.xml configuration?

I'm using log4j2 2.14.0 with armeria 1.3.0. According to the armeria documentation, I could see RequestContext custom atrributes can be exported using com.linecorp.armeria.common.logback.RequestContextExportingAppender in logback configuration. So,…
chacha
  • 23
  • 3
0
votes
0 answers

log4j2 - Can one appender manage more than 1 file "simultaneously"?

I want to create an appender that logs each user actions into a different file per user using the MDC / ThreadContext to save the user name and use it to name the file later on. So for User1 we'd have "web_debug_user1_yyyy-MM-DD", for user2…
Isidro.rn
  • 195
  • 1
  • 12
0
votes
1 answer

Not getting ThreadContext values even after setting "isThreadContextMapInheritable" to true, using Vert.x and Log4j2

I am using Vertx and Log4j2. This is the code for Remote.java public class Remote extends AbstractVerticle { @Override public void start() throws Exception { System.setProperty("isThreadContextMapInheritable", "true"); …
user14733140
0
votes
1 answer

How to make request header available in rxJava threads? Injecting HttpServletRequest in a new thread does not work

I am working on a Spring boot application and need to read request header in a RxJava thread, but injecting HttpServletRequest doesn't work because of a new thread. Passing header from current thread to new thread is unwanted. code flow: Controller…
user10937286
  • 321
  • 1
  • 3
  • 10
0
votes
1 answer

How can I show OrderId on log text as Log4j pattern layout

I'm having trouble getting a log message to display the right way. I'm using this Log4J pattern layout: pattern="ORDERID : $${ctx:ORDERID} %msg%n" I want to see output like: ORDERID: 123 Test Context But this is the output I am getting: ORDERID…
Yasin
  • 123
  • 1
  • 12
0
votes
1 answer

In asp.net core controller, why does ExecutionContext.SuppressFlow() throw "AsyncFlowControl object must be used on the thread where it was created."

I am attempting to suppress the flow of the execution context across asynchronous threads. I've written below code, but it throws an error - InvalidOperationException: AsyncFlowControl object must be used on the thread where it was…
perf-guru
  • 91
  • 3
  • 12
0
votes
1 answer

how one thread can be killed in another thread

Actually,the main scenerio is that : from main thread there are two thread running.By using conditional variable,two threads will be running and sleeping and then it will return to main thread.I mean I dont want different output pattern.just one…
0
votes
1 answer

How to share data between different threads which belong to different classes?

I was reading about async/await recently and I would like to know how to share data between different threads which belong to different classes? Let's assume that we have the HttpContext in some web application. This context contains information…
Joseph Katzman
  • 1,959
  • 6
  • 21
  • 47
0
votes
1 answer

Unable to create multiple log files based on the ThreadContext map values using routing appender in log4j2

I'm using the log4j2 jars in the oracle adf application build on 12c. Requirement: Create multiple log files based on the session and ability to change the logging properties dynamically. Log4j2.xml file
0
votes
1 answer

Async ThreadContext ID

UPDATE Not a Problem now. Didn't realize the theadID returned inside and outside the Dispatcher.Invoke method are different. From my understanding, when using async, the awaiting task T1 will be executed in a different thread and the code following…
Helic
  • 907
  • 1
  • 10
  • 25
0
votes
2 answers

How to properly save and restore thread context on 64 bit process (Windows)?

I've got this code below for releasing library from some 64 bit process. It does its job, but the problem is that after restoring saved context, the target process just crashes. Dunno what is the issue here. It should set all registers and flags for…
0
votes
1 answer

Thread information of intercepting method Spring AOP

Is there a way to find out the thread information of the method which AOP intercepts, using some sort of around advice? E.g if my around advice is intercepting a login method, is there a way to obtain the information of the thread which is actually…
Adithya Puram
  • 303
  • 2
  • 6
  • 23
-1
votes
3 answers

How an OS figures out an identity of a thread calling the GetCurrentThreadId()?

I'm trying to understand how an OS figures out what thread is a current one (for example, when the thread calls gettid() or GetCurrentThreadId()). Since a process address space is shared between all threads, keeping a thread id there is not an…
raiks
  • 1,270
  • 1
  • 15
  • 12
-1
votes
1 answer

How does the shared engine look up the required resources for a process step invocation?

I am using a shared process engine on WebSphere and I want to understand how the engine looks up the required resources (custom code shipped with my process application) for a process step invocation. Is a thread context switch applied?
demon_cleaner
  • 69
  • 1
  • 7
1 2
3