I am having a problem on the Database Trace Listener in the Enterprise Library. I have created the database trace listener and and the procedures and tables, but the data is not logged in the table. Thank you very much.
I need to log data in file and db both. If i comment the database listener, the file listener works but it doesnt work with the database listener. And the database listener doesnt work in any case. Connection string has no problem.
Hi,I am using DAAB (EntLib 3.1, May 2007)
to connect to oracle database. I am having hard time figuring out what this error means and what can I do.I have tried everything I could.I
need some help from you guys out here to resolve this issue. Thanks in advance for your help!ManishI
am getting following error as soons as I call ExecuteDataset method – "ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'GETPARTY'\nORA-06550: line 1, column
7:\nPL/SQL: Statement ignored\n"Here is code I am
using -using System;using
System.Collections;using System.Collections.Generic;using
System.Linq;using System.Text;using
System.Data;using System.Data.Common;//using
System.Data.SqlClient;using Microsoft.Practices.EnterpriseLibrary.Common;using
Microsoft.Practices.EnterpriseLibrary.Data;using Microsoft.Practices.EnterpriseLibrary.Data.Sql;using
Microsoft.Practices.EnterpriseLibrary.Data.Oracle;OracleDatabase
db = DatabaseFactory.CreateDatabase("ELVIS") as OracleDatabase;DbConnectionconn = db.CreateConnection();DbCommand dbCommand = db.GetStoredProcCommand(“pkg.getParty”);db.AddInParameter(dbCommand,
"pPartyID", DbType.Int32, 9600);dbCommand.Connection = conn;DataSet
ds = newDataSet();ds = db.ExecuteDataSet(dbCommand);
Hi...........i am facing the problem with the database trace listener. My webconfig file is exactly the same as you have given on top. I also have added the logging.database.dll. The connection string is also proper. But i don't know what to write in the
AddCategory stored procedure. Can some one help me out!!!! Please tell me what is meant by Add Category Stored procedure and what will be appropriate to write in that?????
Hi, This is the script for the three procedures for oracle database. For SQLServer, the scripts are available in the EntLibSrc directory under logging solution folder.
PROCEDURE usp_Logging_InsertCategoryLog(
V_CategoryID INT,
V_LogID INT
)
AS
v_CatLogCount NUMBER(10) := 0;
BEGIN
SELECT COUNT(CATEGORYLOGID) INTO v_CatLogCount FROM Logging_CategoryLog CL WHERE CL.CategoryID = V_CategoryID and CL.LogID = V_LogID;
IF v_CatLogCount = 0 THEN
INSERT INTO Logging_CategoryLog (CategoryID, LogID) VALUES(V_CategoryID, V_LogID);
END IF;
COMMIT;
END;
PROCEDURE usp_Logging_AddCategory(
v_CategoryName varchar2,
v_LogID int)
AS
v_CatID number(10) := 0;
v_CatCount number(10) := 0;
BEGIN
SELECT COUNT(*) INTO v_CatCount FROM Logging_Category C WHERE C.CategoryName = v_CategoryName;
IF ( v_CatCount = 0 ) THEN
INSERT INTO Logging_Category (CategoryName) VALUES(v_CategoryName);
SELECT CAT_SEQ.CURRVAL INTO v_CatID FROM DUAL;
ELSE
SELECT CategoryID INTO v_CatID FROM Logging_Category WHERE CategoryName = v_CategoryName;
END IF;
You can check if you are having a database trace listener categorySource and the LogWriter is being
written to the Database category. Below code snippet should help you.
ridda
Member
52 Points
18 Posts
Database Trace Listener in the Enterprise Library doesnt work
Mar 27, 2008 10:45 AM|LINK
I am having a problem on the Database Trace Listener in the Enterprise Library. I have created the database trace listener and and the procedures and tables, but the data is not logged in the table. Thank you very much.
I need to log data in file and db both. If i comment the database listener, the file listener works but it doesnt work with the database listener. And the database listener doesnt work in any case. Connection string has no problem.
Here's my web.config:
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="GeneralLog" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add databaseInstanceName="WEBJunctionDbServer" writeLogStoredProcName="WriteLog"
addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
name="Database Trace Listener" />
</listeners>
<formatters>
<add template="Timestamp: {tab}{timestamp}
Category: {tab}{category}
Activity Code: {tab}{eventid}
Priority: {tab}{priority}
Severity: {tab}{severity}
UserName: {tab}{title}
Machine: {tab}{machine}
Application: {tab}{appDomain}
Session Id: {tab}{processId}
Win32 ThreadId: {win32ThreadId}
Thread Name: {tab}{threadName}
Message: {tab}{message}
Payload: {tab}{processName}
Extended Properties: {newline}{dictionary({key} - {value}
)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter"/>
<add template="Extended Properties: {newline}{dictionary({key} - {value}
)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter for DB"/>
</formatters>
<categorySources>
<add switchValue="All" name="GeneralLog"/>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<!--<add name="FlatFile TraceListener"/>-->
<add name="Database Trace Listener" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category"/>
<errors switchValue="All" name="Logging Errors & Warnings"/>
</specialSources>
</loggingConfiguration>
Enterprise Library 2.0- Logging Application Block Asynchronous logging application block Asynchronous enterprise library logging application block
Regards,
Ridda.
ridda
Member
52 Points
18 Posts
Re: Database Trace Listener in the Enterprise Library doesnt work
Apr 18, 2008 05:46 AM|LINK
I have got it working, i didnt add reference to enterprise library's logging.database.dll
Regards,
Ridda.
shrivam
Member
6 Points
4 Posts
Re: Database Trace Listener in the Enterprise Library doesnt work
May 05, 2008 04:11 PM|LINK
dpak.putchak...
Member
2 Points
2 Posts
Re: Database Trace Listener in the Enterprise Library doesnt work
Oct 27, 2008 09:43 PM|LINK
Hi...........i am facing the problem with the database trace listener. My webconfig file is exactly the same as you have given on top. I also have added the logging.database.dll. The connection string is also proper. But i don't know what to write in the AddCategory stored procedure. Can some one help me out!!!! Please tell me what is meant by Add Category Stored procedure and what will be appropriate to write in that?????
asairam@gmai...
Member
2 Points
1 Post
Re: Database Trace Listener in the Enterprise Library doesnt work
Nov 13, 2008 02:50 PM|LINK
Hi, This is the script for the three procedures for oracle database. For SQLServer, the scripts are available in the EntLibSrc directory under logging solution folder.
PROCEDURE usp_Logging_InsertCategoryLog(
V_CategoryID INT,
V_LogID INT
)
AS
v_CatLogCount NUMBER(10) := 0;
BEGIN
SELECT COUNT(CATEGORYLOGID) INTO v_CatLogCount FROM Logging_CategoryLog CL WHERE CL.CategoryID = V_CategoryID and CL.LogID = V_LogID;
IF v_CatLogCount = 0 THEN
INSERT INTO Logging_CategoryLog (CategoryID, LogID) VALUES(V_CategoryID, V_LogID);
END IF;
COMMIT;
END;
PROCEDURE usp_Logging_AddCategory(
v_CategoryName varchar2,
v_LogID int)
AS
v_CatID number(10) := 0;
v_CatCount number(10) := 0;
BEGIN
SELECT COUNT(*) INTO v_CatCount FROM Logging_Category C WHERE C.CategoryName = v_CategoryName;
IF ( v_CatCount = 0 ) THEN
INSERT INTO Logging_Category (CategoryName) VALUES(v_CategoryName);
SELECT CAT_SEQ.CURRVAL INTO v_CatID FROM DUAL;
ELSE
SELECT CategoryID INTO v_CatID FROM Logging_Category WHERE CategoryName = v_CategoryName;
END IF;
usp_Logging_InsertCategoryLog(v_CatID, v_LogID);
COMMIT;
END;
PROCEDURE usp_Logging_ClearLogs
AS
BEGIN
DELETE FROM Logging_CategoryLog;
DELETE FROM Logging_Log;
DELETE FROM Logging_Category;
COMMIT;
END;
PROCEDURE usp_Logging_WriteLog
(
v_EventID int,
v_Priority int,
v_Severity varchar2,
v_Title varchar2,
v_Timestamp date,
v_MachineName varchar2,
v_AppDomainName varchar2,
v_ProcessID varchar2,
v_ProcessName varchar2,
v_ThreadName varchar2,
v_Win32ThreadId varchar2,
v_Message varchar2,
v_FormattedMessage varchar2,
v_LogId OUT int
)
AS
BEGIN
INSERT INTO Logging_Log (
EventID,
Priority,
Severity,
Title,
LOGTIME,
MachineName,
AppDomainName,
ProcessID,
ProcessName,
ThreadName,
Win32ThreadId,
Message,
FormattedMessage
)
VALUES (
v_EventID,
v_Priority,
v_Severity,
v_Title,
sysdate,
v_MachineName,
v_AppDomainName,
v_ProcessID,
v_ProcessName,
v_ThreadName,
v_Win32ThreadId,
v_Message,
v_FormattedMessage);
SELECT LOG_SEQ.CURRVAL INTO v_LogID FROM DUAL;
COMMIT;
END;
Sairam
ghousebarq
Member
6 Points
7 Posts
Re: Database Trace Listener in the Enterprise Library doesnt work
Apr 29, 2011 06:22 AM|LINK
You can check if you are having a database trace listener categorySource and the LogWriter is being written to the Database category. Below code snippet should help you.
-Mohammed Ghouse Ibne Barq Kadapavi
http://www.ProgrammersVision.blogspot.com
https://sites.google.com/site/BarqKadapavi
http://www.ProgrammersVision.blogspot.com/
https://sites.google.com/site/BarqKadapavi