Patent attributes
Activity-based sampling provides useful and relevantly focused diagnostic data, connected to improve a developer's understanding. An application invokes log-event procedures, causing a logger to check logging conditions and make a log entry when a logging condition is satisfied. The logger has a set of log-enabled activities, and one or more start-events with respective sampling frequency conditions. One logging condition is that a current activity-id be log-enabled. Another states that if the current activity-id is not log-enabled but the log-event procedure identifies a start-event consistent with the sampling frequency condition, the activity is log-enabled and a log entry is made. Creation of a child activity by a parent activity which is in the set of log-enabled activities is noted in the log, and the child is automatically log-enabled. A log consumer may reside inside or outside the application. Event Tracing for Windows services can be enhanced to support activity-based sampling.