Apache Camel上下文日志在Weblogic控制台日志而不是文件上打印

时间:2016-11-30 12:14:07

标签: spring log4j apache-camel

我正在使用Apace Camel + Spring。我正在尝试使用log4j将我的日志从Camel Context打印到文件中。我在Camel Context中使用Log组件

func (c *Context) SetCookie(
    name string,
    value string,
    maxAge int,
    path string,
    domain string,
    secure bool,
    httpOnly bool,
) {
    if path == "" {
        path = "/"
    }
    http.SetCookie(c.Writer, &http.Cookie{
        Name:     name,
        Value:    url.QueryEscape(value),
        MaxAge:   maxAge,
        Path:     path,
        Domain:   domain,
        Secure:   secure,
        HttpOnly: httpOnly,
    })
}

func (c *Context) Cookie(name string) (string, error) {
    cookie, err := c.Request.Cookie(name)
    if err != nil {
        return "", err
    }
    val, _ := url.QueryUnescape(cookie.Value)
    return val, nil
}

我也添加了log4j.properties。 但是日志将打印在Weblogic控制台上,而不是log4j.properties中指定的文件。

log4j.properties文件

<log  loggingLevel="ERROR" message="Testing Logs with log4j" />

0 个答案:

没有答案