FCFL.NET Common Library - API Reference
SetThreadContextValue Method

The key or name to use for this variable.
The current value to assign to this variable for this thread.
Sets a context variable for this thread.
Syntax
'Declaration
 
Public Shared Sub SetThreadContextValue( _
   ByVal key As String, _
   ByVal value As String _
) 
public static void SetThreadContextValue( 
   string key,
   string value
)

Parameters

key
The key or name to use for this variable.
value
The current value to assign to this variable for this thread.
Remarks

This variable allows you to add contextual information to your log entries (like the session ID or username of the currently logged-in user, etc. This applies only when using manual configuration of LogManager through configuration file. In the <layout> section of an appender, you can add the value of a thread context variable using the following syntax:

 

[%X{user} %X{session}]

 

You can then set two thread context values for key "user" and key "session" and they will print out in the log file.

 

For more information on configuring LogManager and defining appenders and layouts, please consult the user guide for your application.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Reference

LogManager Class
LogManager Members

 

 


© 2010 Dovetail Software, Inc. - All rights reserved.
- Clarify, Amdocs, and related products and names are copyright and trademark of Amdocs, Inc.
- .NET, Visual Studio.NET, C#, Visual Basic and related products are trademark of Microsoft corporation.

Send comments on this topic.