Velocity provides detailed logs. The lifecycle and access records of the cache in the cluster can be recorded.
InCodeTo Enable Logging
Using System; Using System. Collections. Generic; Using System. LINQ; Using System. text; // Add? ? Null? Between? Using Microsoft. Data. caching; Using System. diagnostics; Namespace Volocitydemo { Class Log {datacachefactory factory; Public Log () {factory = New Datacachefactory ();}~ Log (){ // Factory. Dispose (); } Public Void Test (){ // Create a list for the desired log sinks List <datacachelogsink> sinklist = New List <datacachelogsink> (2 ); // Create file-based Log sink, capture warnings and errors Datacachelogsink filebasedsink = New Datacachelogsink (datacachesinktype. File, tracelevel. verbose ," Dcache/yyyy-mm-dd "); // Create console-based Log sink, capture warnings and errors Datacachelogsink consolebasedsink = New Datacachelogsink (datacachesinktype. Console, tracelevel. verbose ); // Add the log sinks to the sink list Sinklist. Add (filebasedsink); sinklist. Add (lelebasedsink ); // Enable the sinks Datacachefactory. createlogsinks (sinklist );}}}
After logging is enabled, you can view detailed logs on the command console (in this example, set the tracelevel attribute to verbose and record all logs ).
At the same time in the ApplicationProgramYou can see the recorded text logs in the directory. Name in this life-saving is: DCache2011-08-19.log