Jonathan Rockway wrote:
I think you should have an option for both.
Use case A, you want to run something every 5 minutes (clean sessions,
update stock ticker, whatever). That, you'll just want logged.
Use case B, you want a nightly report (or something), and you will
probably want e-mail about that.
So how about the engine inspects the response ... and decides based on
a header
what to do with it (email, log or both)...
X-Job-Response-Transport: email, log
Should the other two options also be decided via headers?
X-Job-Response-Content: status, headers, body
X-Job-Response-LogByStatus: yes
(Of course there will be fallbacks for each option)
or just try to act smartly like suggested below?
What should the engine do with it? It can email it and/or log it. Any
other ideas? How much of the response should get emailed/logged? The
full thing:
200 OK
X-Catalyst: 5.7002
html
...
html
Or just the body, body+headers,body+status?
Should the log level be computed from the response status (i.e. 100-399
- info level, 400+ - error level)?
Log should just log that the event ran (to info), and the $c-error if
there was an error. If you want warnings to be logged, I suggest having
a plugin for that :)
E-mail should probably log that the event ran, and then send the body
if the response is 200 OK. If there was an error, log the details, and
then mail or log the error message, headers, response, probably the
request, and maybe the contents of the stash; depending on debug levels
of course.
My $0.02
Regards,
Jonathan Rockway
Thx,
Kiki
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/