- 3,716,000 Users
- 2,242,928 Discussions
- 7,845,734 Comments
Forum Stats
Discussions
Categories
- 17 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 1.6K Databases
- 476 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 5 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 417 SQLcl
- 42 SQL Developer Data Modeler
- 184.9K SQL & PL/SQL
- 21K SQL Developer
- 1.9K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 9 DevOps
- 3K QA/Testing
- 256 Java
- 6 Java Learning Subscription
- 10 Database Connectivity
- 67 Java Community Process
- 1 Java 25
- 9 Java APIs
- 141.1K Java Development Tools
- 6 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 125 LiveLabs
- 30 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 3 Deutsche Oracle Community
- 11 Español
- 1.9K Japanese
- 2 Portuguese
ODP.NET custom trace listener possible?

Hi,
I wonder, if its possible in ODP.NET to do a custom trace, e.g. writing to custom logger or e.g. Cloud Watch, etc. I can see Trace.cs resits in OracleInternal and Trace.Write is internal static. It would be nice, if there e.g. would be a custom listener possible to register. E.g. delegate OnCustomTraceWrite....
-Michael
Answers
-
What is the business requirement for this feature request? It would help the Oracle .NET team understand the feature's importance.
In general, the consumer of the trace is Oracle Dev and Support to be able to diagnose problems.
-
Hi Alex,
the business requirement would be: As an ODP.NET client user I want to be able to add custom trace loggers, so that I can log and analyze Oracle client library on a daily basis, e.g. by logging to rolling file appenders, 3rd party logging frameworks or cloud logging providers such as AWS cloudwatch or Application Insights.
-
Almost all users turn off tracing in production because it slows down performance, which is one reason not to have it running all the time.
My question was more along the lines of what do you plan to do with the ODP.NET tracing info? What actionable decisions will you make based on what it outputs? The real useful data from the trace are ODP.NET's internal calls and APIs, which only Oracle Development can modify.
-
Hi Alex,
I can see your point. Not all oracle traces are internal only, see OracleTraceLevel.Public vs OracleTraceLevel.Private. I am very interested in OracleTraceTag.SQL to be able to track SQL commands with execution time and success/non success. It would be best to have the below specific delegate to optionally use to get callbacks after every OracleCommand (ExecuteNonQuery, ExecuteReader, ...).
delegate void OnCommandExecuted(string commandText, DateTimeOffset startTime, TimeSpan duration, bool success);
-
user5543674 wrote:Hi Alex, I can see your point. Not all oracle traces are internal only, see OracleTraceLevel.Public vs OracleTraceLevel.Private. I am very interested in OracleTraceTag.SQL to be able to track SQL commands with execution time and success/non success. It would be best to have the below specific delegate to optionally use to get callbacks after every OracleCommand (ExecuteNonQuery, ExecuteReader, ...). delegate void OnCommandExecuted(string commandText, DateTimeOffset startTime, TimeSpan duration, bool success);
That sounds more like a job for extended SQL trace on the database. You can enable it for particular sessions or use dbms_monitor to enable it for any client that uses a certain module/action. Have a read of https://docs.oracle.com/database/121/TGSQL/tgsql_trace.htm#TGSQL792
Not only will you see what SQL you spend your time on, you’ll see why you spend time on that SQL
-
I agree with Andrew. What you're looking for can be accomplished through Oracle DB's tools. It has the advantage of being able to turn tracing on for individual SQL commands through module or action instead of tracing every single ODP.NET foreground and background operation.