I just submitted this request:
http://noc.postnuke.…group_id=5&atid=104
Here is the text:
It would be helpful to developers and administrators
if there was a PostNuke logging facility available.
For example, from a module, block, or theme you could
call:
pnLogger("Admin: lookup", "No record found");
The first parameter is a meaningful key.
The second parameter is the actual log information.
Additional information (timestamp, userid, ...) would
be filled in by the pnLogger function and stored in an
SQL table.
Logging could be used to trace modules that cause PN
crashes during development. Exceptions, unusual
conditions, security hacks could also be logged.
Anything that was unnecessary for the end user to see.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- Guite responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 05:53 PM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Provide a PostNuke logging function
-
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
boy - I wish I had the time, that seems like it would be an easy module to write. Then someone would need to campaign to get it into the core. Maybe if I get a few hours next week. maybe. maybe. -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
If you need some help, I'm here for you!
I could write the module but... I would really like to see it in PostNuke itself. Maybe with a little direction from the PN developers we could make this happen. -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
If you can, I suggest you do so. I don't think it would be that difficult because it would be a module that provides functionality, but content. I would pattern it after many of the NS-*** modules. Then the API would just provide the pnLogger() function you mention. Then for a mod-dev to use it, they would load the API and call the function. (At least I think that is how it should work - maybe Mark would have some input.... MARK!!?!?!?! :)) -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
A generic event logger seems like a useful addon for all sorts of things. I'd need to see a more in depth proposal but like the general idea. At this stage I can only offer advice as i've 101 other things going on.
Any module should be fully pnAPI compliant. Thus not in any way based on NS-* modules which are non-API compliant and prefixed with that nasty, nasty NS- prefix which is dropped for .8.
-Mark -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
I really would prefer a PN function call (i.e. a pnAPI) as opposed to a module call. This avoids the need to load/initialize/whatever.
This way you could for example put:
Code
pnLogger("Admin: lookup", "No record found");
anywhere in your theme/block/module. Simple and useful, without any other overhead. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
An API would be ok but given that'd we would need a module control panel it makes sense to modularise it. The API would only be a wrapper to the module and fallback to setting the error message session var if not. i.e.
Code
function pnLogger($errtype, $errno, $errseverity, $errmsg.....)
{
$return = false;
if (pnModAvailable('pnLogger') && pnModAPILoad('pnLogger', 'user)) {
$return = pnModAPIFunc('pnLogger', 'user', 'logerror', array(.....));
}
if ($return == false) {
pnSessionSetVar('errormsg', $errtype . ':' . $errmsg ......);
}
}
The other thing to consider would be the visual presentation of errors. In the .8 cvs we have the basic construct of an errors module for the visual display of errors - this would need to be linked in to here somehow - perhaps an additional flag to display the error message.
-Mark -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
Makes sense to me. I will register 'pnLogger' at the NOC.
I would like to here suggestions about what sould be included in this module. I realize it is fairly simple module but I don't want to assume anything. My first criteria: Keep it simple.
Thanks for the feedback so far! -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Follow the 'keep it simple' approach. Via pnModAPI* calls further modules can interact. To my mind a module should do one thing and do it well. Anything else is a complication.
-Mark
--
Visit My homepage and Zikula themes. -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 33
What ever happened to the idea of providing a system-wide logger in postnuke core? Surely, webmasters are using some kind of logger for system messages in the PostNuke unstallations, no? How are you folks doing so? I found pnLogger module, but it's in beta. Thoughts, anybody?
:?: -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: Jun 11, 2008
- Posts: 225
pnLogger is my next project after finishing up with the RemoteBlock module. Functionally it won't change much, I just plan to convert the interface to templates and release v1.0. Use it and send me some feedback.
- Moderated by:
- Support
