Quantcast
Channel: Azure Management Portal forum
Viewing all articles
Browse latest Browse all 4189

How to implement remote logging using ETW in C#

$
0
0
Hi, 

We have implemented ETW logging in C# and it is working fine if we put logs on local machine. The C# code for local machine are as follow:

         private void button1_Click(object sender, EventArgs e)
        {
            var provider = new EventProvider(new Guid("{CDDA7178-6A9D-4C86-860B-4074116458BC}"));

            System.Diagnostics.Eventing.EventDescriptor descriptor;
            unchecked
            {
                //  EventDescriptor(int id, byte version, byte channel, byte level, byte opcode, int task, long keywords);
                descriptor = new System.Diagnostics.Eventing.EventDescriptor(0x7d1, 0x1, 0x9, 0x2, 0x0, 0x0, (long)0x4000000000000000); // Keywords
            }

            for (int i = 0; i < 5; i++)
            {
                provider.WriteEvent(ref descriptor, i);  
            }
        }

I am confused about the usage of overloaded method -> provider.WriteEvent(ref descriptor, eventPayload); // where eventPayload is an object array. 

I want to implement logs on remote machine by using the same ETW mechanism. Kindly provide the solutions.

Thanks

Viewing all articles
Browse latest Browse all 4189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>