[coldbox 4.2.0] How to log codeerrors wthin views via logbox, if an errortemplate is used

已查看 28 次
跳至第一个未读帖子

ms.9...@gmail.com

未读,
2016年8月9日 06:35:462016/8/9
收件人 ColdBox Platform
I upgraded from cb3.8 to cb4.2 and found that errors that occur within view-templates are not automatically logged with logbox. How can I do that?
Thanks, Martin

Luis Majano

未读,
2016年8月9日 11:08:182016/8/9
收件人 coldbox
It all depends how you have configured LogBox martin, can you share your LogBox confriguration
On Tue, Aug 9, 2016 at 5:35 AM, <ms.9...@gmail.com> wrote:
I upgraded from cb3.8 to cb4.2 and found that errors that occur within view-templates are not automatically logged with logbox. How can I do that?
Thanks, Martin

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+unsubscribe@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/bf8765b0-5ab1-418d-8d3e-c6cf870aea4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ms.9...@gmail.com

未读,
2016年8月10日 02:03:502016/8/10
收件人 ColdBox Platform
logBox =
{
    // Define Appenders
    appenders =
    {
        /*coldboxTracer =
        {
            class = "coldbox.system.logging.appenders.ColdboxTracerAppender"
        }, */
        LogMail =
        {
            class = "coldbox.system.logging.appenders.EmailAppender", properties =
            {
                subject = "Fehler in ueberwachung-Infobase", from = "ueberwachu...@xxx.de", to = "ad...@xxx.de"
            }, levelMin = "FATAL", levelMax = "FATAL"
        },LogMail2 =
        {
            class = "coldbox.system.logging.appenders.EmailAppender", properties =
            {
                subject = "Fehler in ueberwachung-Infobase", from = "ueberwachu...@xxx.de", to = "info...@xxx.de"
            }, levelMin = "FATAL", levelMax = "ERROR"
        }, LogFile =
        {
            class = "coldbox.system.logging.appenders.FileAppender",  properties =
            {async=true,
                filePath = "/wartung_files/logfiles/", filename = "logfile", fileEncoding = "UTF-8", autoExpand = 'true', fileMaxSize = '2000', fileMaxArchives = '20'
            }, levelMin = "FATAL", levelMax = "WARN"
        }, LogDB =
        {
            class = "coldbox.system.logging.appenders.DBAppender", properties =
            { async=true,
                dsn = "ueberwachung_2013", table = "tb_coldboxlog", autocreate = false
            }, levelMin = "FATAL", levelMax = "WARN"
        }
    },
    // Root Logger
    root =
    {
        levelmin = "FATAL", levelmax = "WARN", appenders = "*"
    },
};

logbox.categories["coldbox.system"]={levelmin="OFF",levelmax="OFF",appenders="*"};

Luis Majano

未读,
2016年8月10日 11:14:162016/8/10
收件人 coldbox

On Wed, Aug 10, 2016 at 1:03 AM, <ms.9...@gmail.com> wrote:
    levelmin = "FATAL", levelmax = "WARN", appenders = "*"

do you have a small test case we can reproduce?

Brad Wood

未读,
2016年8月10日 23:31:282016/8/10
收件人 ColdBox Platform
Do you have an exception handler configured in your config/ColdBox.cfc file like so:

exceptionHandler = "main.onException",

ColdBox will only automatically log the error if you do NOT have a n exception handler.  If you do have an exception handler, it's up to you to log the error yourself.  
Ex:

function onException(){
log.error( prc.exception.getMessage(), prc.exception );
}

ms.9...@gmail.com

未读,
2016年8月11日 02:23:162016/8/11
收件人 ColdBox Platform
I have an exception-handler configured. Thanks Brad, "log.error( prc.exception.getMessage(), prc.exception )" is what I wanted to know.
回复全部
回复作者
转发
0 个新帖子