Questions tagged [threadcontext]
45 questions
2
votes
1 answer
Teaching gdb to understand micro-threads from core files
I am working on a huge program that employs a (custom built) micro-threading solution. It sometimes happens that I need debug a crash. During such times, it is useful to be able to switch from one micro-thread to another.
If I'm doing live…

Shachar Shemesh
- 8,193
- 6
- 25
- 57
1
vote
0 answers
How do you map the thread context when integrating a WCF service and the service bus
I'm building an azure application with a windows client, a wcf service and a worker role on azure that handles a lot of back ground processing. In some cases I need the wcf service to hand over a task to the back ground process (via a queue) and…

user1108880
- 11
- 1
1
vote
1 answer
java.lang.NoSuchMethodError: org.apache.logging.log4j.ThreadContext.getThreadContextMap()
I have a spring mvc application with log4j 2.9.1. It used to work fine, but all of a sudden, I get
Caused by: java.lang.NoSuchMethodError: org.apache.logging.log4j.ThreadContext.getThreadContextMap()Lorg/apache/logging/log4j/spi/ThreadContextMap;
…

TNAR
- 21
- 1
- 6
1
vote
1 answer
Trust Boundary Violation flaw in Java project
For the below mentioned code, I'm getting Trust Boundary Violation in the CheckMarx report.
Error description -
…
user9755712
1
vote
1 answer
Can we set the characters limited to 10 characters in log4net %property?
This is my threadContext exception message property
log4net.ThreadContext.Properties["excmessage"] = ex.Message;
I want to get the first 10 characters of exception message property using log4net.
This is the line in…

Techgeeks1
- 556
- 1
- 4
- 18
1
vote
0 answers
Using ThreadContext instead of HttpContext?
I have a 3 tiered architecture (Controller/Service/Repository) as well as a Domain for models that all layers will need. Each layer includes the domain, and each layer includes it's "parent" layer. So Repository -> Service -> Api
When a request…

micah
- 7,596
- 10
- 49
- 90
1
vote
2 answers
how to insert into database from stored procedure in log4net?
I have to log thread context properties like this:
string logFilePath = AppDomain.CurrentDomain.BaseDirectory + "log4netconfig.xml";
FileInfo finfo = new FileInfo(logFilePath);
log4net.Config.XmlConfigurator.ConfigureAndWatch(finfo);
ILog logger =…

Sam P
- 127
- 2
- 10
1
vote
1 answer
Jruby thread context instance association
I am trying to eval javascript in ruby.
config/initializer/initializer_context.rb
js_str =
EXEC_PP_CONTEXT = ExecJS.compile("function test_add(param) { return param.a+ param.b;}")
and then in my controller I am using :
data_hash =…

Gaurav Shah
- 5,223
- 7
- 43
- 71
1
vote
2 answers
How can we create a callcontext for async .net methods?
In a synchronous environment, it is easy to create a scoped context which allows you to attach out-of-band context to your current thread. Examples of this are the current TransactionScope or thread-static logging context.
using (new MyContext(5))
…

Jochen
- 95
- 9
1
vote
1 answer
Segmentation fault after swapcontext in alarm handler
Basically what I am trying to do is simulate multithreading on a single thread with context switching. I set up an alarm for every 10 microseconds, and I switch the context from one to another thread. The problem is that about one in 5 runs ends up…

Cristi M
- 446
- 4
- 13
1
vote
1 answer
Setting & Getting Values from ThreadContext in log4j2
I am using log4j-api-2.0-beta4.jar along with sl4j in my web-app.
I am trying to insert some values into ThreadContext.
ThreadContext.put("user",userName); ThreadContext.put("thread",thread);
ThreadContext.put("url",url);
All I have done…

Shashi
- 339
- 1
- 4
- 15
0
votes
2 answers
How to transfert some of the ThreadContext values in a thread created by ScheduleExecutorService?
I use Executor.newSingleThreadScheduled Executor() to do a very simple repetitive task which works great.
But because it is in another thread, I lose the correlation_Id that is in my ThreadContext and the logs created by the child thread are…

0c7
- 3
- 5
0
votes
0 answers
spring Webclient and custom logger, how to keep context?
I call a REST api using Webclient
i am using a customized netty HTTPClient with a loggingHandler that I use to log my call. (I got it from here WebClient - how to get request body?)
@Slf4j
@Component
public class LoggingCustomizer implements…

0c7
- 3
- 5
0
votes
1 answer
Log4j ThreadContext from child thread
I'm using with Log4J2 and ThreadContext and basically, I want the ThreadContext shared across all threads (or an alternative to ThreadContext, as the name seems to imply it should be thread-specific).
Right now I have both of these flags set in my…

Travis
- 76
- 1
- 11
0
votes
0 answers
ThreadContext leaking between requests even after over defensive clean up
We are using org.apache.logging.log4j.ThreadContext in a default scoped bean to store user properties in the span of the request. This is from the package : log4j-api-2.12.1.jar.
While making API request to another service, we use this bean to get…

Abhrajit Chattopadhyay
- 1
- 1
- 2