Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB

  1. using System;
  2. using System.Data;
  3. using System.Data.SqlClient;
  4. using System.IO;
  5. using System.Text;
  6. using System.Xml;
  7. using System.Xml.Serialization;
  8. using UDDI;
  9. using UDDI.Diagnostics;
  10. namespace UDDI.API
  11. {
  12. public class QueryLog
  13. {
  14. public static void Write( QueryType queryType, EntityType entityType )
  15. {
  16. //
  17. // This can sometimes be an expensive call, so avoid it if possible.
  18. //
  19. if( 1 == Config.GetInt( "Audit.LogQueries", 0 ) )
  20. {
  21. SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor( "net_queryLog_save" );
  22. sp.Parameters.Add( "@contextID", SqlDbType.UniqueIdentifier );
  23. sp.Parameters.Add( "@lastChange", SqlDbType.BigInt );
  24. sp.Parameters.Add( "@contextTypeID", SqlDbType.TinyInt );
  25. sp.Parameters.Add( "@entityKey", SqlDbType.UniqueIdentifier );
  26. sp.Parameters.Add( "@queryTypeID", SqlDbType.TinyInt );
  27. sp.Parameters.Add( "@entityTypeID", SqlDbType.TinyInt );
  28. //
  29. // TODO: add the entityKey
  30. //
  31. sp.Parameters.SetGuidFromString( "@entityKey", "00000000-0000-0000-0000-000000000000" );
  32. sp.Parameters.SetGuid( "@contextID", Context.ContextID );
  33. sp.Parameters.SetLong( "@lastChange", DateTime.UtcNow.Ticks );
  34. sp.Parameters.SetShort( "@contextTypeID", (short)Context.ContextType );
  35. sp.Parameters.SetShort( "@queryTypeID", (short)queryType );
  36. sp.Parameters.SetShort( "@entityTypeID", (short)entityType );
  37. sp.ExecuteNonQuery();
  38. }
  39. }
  40. }
  41. }