Click or drag to resize

Events and logs

Packflow provides two contents to log history information.

Log entries will contain information about technical history and exceptions while events represent items' history.

Logs
  • Apply to: Site, Application, Content-Type.
  • Type of content: technical events, warnings, errors, group modifications, etc.
  • Target users: administrators, developers.

Consultation

Logs can be consulted:
  1. In Packflow Manager: on every site or application node.
  2. In the Web Administration: on the Monitoring - Events page.

API

Log entries can be accessed and created from PFSite, PFApplication and PFContentType objects using the PFRelation:

C#
//Direct access
PFApplication app;
PFLogEntry entry = app.Logs.Add();
entry.Category = PFLogger_Category.Interface.ToString();
entry.Description = "Information message";
entry.Identification = CurrentItem.LogIdentification;
entry.Level = PFLogger_Level.Information.ToString();
entry.User = CurrentUser.LoginName;
entry.Trace = Environment.StackTrace;
entry.Save();

But it can be much simpler to use the Logger object, available on all Packflow objects:

C#
//Use of the Logger object
PFItem item;
item.Logger.Error("Something went wrong", PFLogger_Category.Other);

It offers many other methods and overloads.

Events
  • Apply to: Item.
  • Type of content: item history like workflow enactment, task event, notifications.
  • Target users: everyone.

Consultation

Logs can be consulted:
  1. In the Web Administration: on the Monitoring - Events page, when an application is selected.
  2. In the administration part of all item forms.

API

Events can be accessed and created from the Events relation on PFItem:

C#
PFItem item;
item.Events.Insert("New event", "Event description");

That method also allows to:

  • Create the event asynchronously.
  • Set a custom event actor.
  • Restrict its visibility to administrators.