- 
                Notifications
    You must be signed in to change notification settings 
- Fork 316
Adding EventSource to NetFx #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 38 commits
      Commits
    
    
            Show all changes
          
          
            51 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      4670349
              
                EventTrace for NetFx, changes made to SqlConnection
              
              
                JRahnama c7c1504
              
                EventSource for NetFx
              
              
                JRahnama aab8e8b
              
                Adding IsTraceEnabled
              
              
                JRahnama 2dd4373
              
                EventSource NetFx to Review
              
              
                JRahnama ebca243
              
                Taking unused variable out
              
              
                JRahnama c4d9289
              
                Ignore on .NetCore
              
              
                JRahnama 7a747b4
              
                Update EventSourceTest.cs
              
              
                JRahnama 5b73edb
              
                Adding if blocks
              
              
                JRahnama 8049005
              
                Merge branch 'EventSource' of https://github.com/JRahnama/SqlClient i…
              
              
                JRahnama 5198d21
              
                EventSource
              
              
                JRahnama 9fb8af8
              
                Documentation
              
              
                JRahnama d373dd1
              
                Adding Tests and documentation
              
              
                JRahnama c3a27a4
              
                Fixing Tests issues in NetCore
              
              
                JRahnama f39321c
              
                moving from Functional to Manual Tests
              
              
                JRahnama 40df85b
              
                EventSource
              
              
                JRahnama 8c5af73
              
                EventSource unwanted reference
              
              
                JRahnama 44bb6c2
              
                Taking extra documentation file out.
              
              
                JRahnama a650fa8
              
                Deleting unwanted file from NetCore
              
              
                JRahnama 4b3a737
              
                EventSource
              
              
                JRahnama 435c9d7
              
                Additional Improvments
              
              
                JRahnama 4bc920c
              
                Taking the Static reference out
              
              
                JRahnama 7ac0742
              
                Removing Extra lines and unwanted SqlClient Reference from SqlClientE…
              
              
                JRahnama 2da6e5b
              
                Merge branch 'master' into EventSource
              
              
                JRahnama ab912e6
              
                Changing documentation and adding Advanced Keyword
              
              
                JRahnama 23c6d0e
              
                Merge branch 'EventSource' of https://github.com/JRahnama/SqlClient i…
              
              
                JRahnama 9557b3a
              
                Adding Overloaded methods in EventSource
              
              
                JRahnama 1a098a3
              
                Merge branch 'master' of https://github.com/dotnet/SqlClient into Eve…
              
              
                JRahnama 9d11677
              
                Fixing test issues
              
              
                JRahnama 6397d77
              
                more fixes
              
              
                JRahnama 4cf1a08
              
                EventSource
              
              
                JRahnama 388bba6
              
                ActivityCorrelator added.
              
              
                JRahnama 96614db
              
                ActivityCorrelator added.
              
              
                JRahnama fd7f452
              
                Merge branch 'EventSource' of https://github.com/JRahnama/SqlClient i…
              
              
                JRahnama f0c1c0a
              
                fixing AdvanceTraceOn issues
              
              
                JRahnama 11b90fc
              
                StateDump
              
              
                JRahnama 71fee3d
              
                Removing if statement from code and placing them inside EventSource
              
              
                JRahnama 6e52add
              
                integrating SqlEventSource to SqlClientEventSource
              
              
                JRahnama 26d3c2e
              
                Adding null value checker to SqlDependencyListener EventSource logger
              
              
                JRahnama 5b1a7ee
              
                EventSource
              
              
                JRahnama 34bedaf
              
                Fixing ScopeLeave related logic
              
              
                JRahnama e3fa4a4
              
                Fixing PR issues and Tests
              
              
                JRahnama 7e293d3
              
                EventSource
              
              
                JRahnama 42df9ec
              
                EventSource
              
              
                JRahnama 959ca03
              
                EventSource
              
              
                JRahnama 7c55d8c
              
                Removing Doc
              
              
                JRahnama ad7a3bd
              
                ExceptionTrace Fix
              
              
                JRahnama dac6ecf
              
                Update SqlAuthenticationProviderManager.cs
              
              
                JRahnama dc79898
              
                Update SqlBulkCopy.cs
              
              
                JRahnama 52b9e6d
              
                Update SqlConnectionFactory.cs
              
              
                JRahnama 18eccbe
              
                Update SqlConnectionPoolGroupProviderInfo.cs
              
              
                JRahnama 27f3bba
              
                Update SqlCommand.cs
              
              
                JRahnama File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| using System; | ||
| using System.Data; | ||
| using System.Diagnostics.Tracing; | ||
| using Microsoft.Data.SqlClient; | ||
|  | ||
| // <Snippet1> | ||
| class Program | ||
| { | ||
| static void Main() | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| using (var listener = new SampleEventListener()) | ||
| { | ||
| //This Enables events for Keywords.Tracing | ||
| //We also can select EventKeywords.All to get all possible available events. | ||
| listener.EnableEvents(SqlClientEventSource.Log, EventLevel.Informational, SqlClientEventSource.Keywords.Trace); | ||
| using (SqlConnection connection = new SqlConnection("Data Source=tcp:localhost;Database=Northwind;Integrated Security=SSIP;")) | ||
| { | ||
| connection.Open(); | ||
| using (SqlCommand command = new SqlCommand("SELECT * From [Customers]", connection)) | ||
| { | ||
| command.ExecuteNonQuery(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|  | ||
| public class SampleEventListener : EventListener | ||
| { | ||
| static TextWriter Out = Console.Out; | ||
|  | ||
| /// <summary> | ||
| /// We override this method to get a callback on every event. | ||
| /// </summary> | ||
| /// <param name="eventData"></param> | ||
| protected override void OnEventWritten(EventWrittenEventArgs eventData) | ||
| { | ||
| // report all event information | ||
| Out.Write(" Event {0} ", eventData.EventName); | ||
|  | ||
| // Events can have formatting strings 'the Message property on the 'Event' attribute. | ||
| // If the event has a formatted message, print that, otherwise print out argument values. | ||
| if (eventData.Message != null) | ||
| Out.WriteLine(eventData.Message, eventData.Payload.ToArray()); | ||
| else | ||
| { | ||
| string[] sargs = eventData.Payload != null ? eventData.Payload.Select(o => o.ToString()).ToArray() : null; | ||
| Out.WriteLine("({0}).", sargs != null ? string.Join(", ", sargs) : ""); | ||
| } | ||
| } | ||
| } | ||
| // </Snippet1> | ||
        
          
          
            44 changes: 0 additions & 44 deletions
          
          44 
        
  src/Microsoft.Data.SqlClient/netfx/src/BID/INC/CS/AssemblyTemplate_BID.cs
  
  
      
      
   
        
      
      
    This file was deleted.
      
      Oops, something went wrong.
      
    
  
        
          
          
            145 changes: 0 additions & 145 deletions
          
          145 
        
  src/Microsoft.Data.SqlClient/netfx/src/BID/INC/CS/BidPrivateBase.cs
  
  
      
      
   
        
      
      
    This file was deleted.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.