jeremy-farrance / AccuratySolutions-2023

AccuLadder and other helper stuff
MIT License
0 stars 0 forks source link

Add ability to log to the DNN EventLog #13

Open jeremy-farrance opened 1 month ago

jeremy-farrance commented 1 month ago

Some things needed or wanted:

jeremy-farrance commented 1 month ago

My quick experiment (in FCTRL2024 2sxc/Content/Accu/Heading__Basic.cshtml

@using DotNetNuke.Abstractions.Logging
@using DotNetNuke.Services.Log.EventLog

@{
  // Log an event - keep is simple, just Name, Value, and Type
  var dnnLogger = GetService<IEventLogger>();  // the 2sxc way to get the DNN logger
  dnnLogger.AddLog("2sxc / Content App", "Heading__Basic.cshtml", EventLogType.ADMIN_ALERT);
}

The above works in 2sxc, what does the same thing look like in a .ascx (skin) file?

How do we want this to work in Accu something.cs? And, what is the right interface?

// important: used named params and default EventLogType to ??
Accu.Dnn.Log(type: EventLogType.ADMIN_ALERT, 
  name: "2sxc / Content App", 
  value: "Heading__Basic.cshtml"
);