Package org.apache.marmotta.platform.core.model.logging

Examples of org.apache.marmotta.platform.core.model.logging.LoggingOutput


     */
    @GET
    @Path("/appenders/{id}")
    @Produces("application/json")
    public Response getAppender(@PathParam("id") String id) {
        LoggingOutput appender = loggingService.getOutputConfiguration(id);
        if(appender != null) {
            return Response.ok(appenderToJSON(appender)).build();
        } else {
            return Response.status(Response.Status.NOT_FOUND).build();
        }
View Full Code Here


        String type  = (String) values.get("type");
        String name  = (String) values.get("name");
        String level   = (String) values.get("level");
        String pattern = (String) values.get("pattern");

        LoggingOutput appender = loggingService.getOutputConfiguration(id);
        if(appender == null) {
            // type information required
            Preconditions.checkArgument(type != null, "appender type was not given");
            Preconditions.checkArgument(name != null, "appender name was not given");

            if("logfile".equals(type)) {
                String file = (String) values.get("file");

                Preconditions.checkArgument(file != null, "logfile name was not given");

                appender = loggingService.createLogFileOutput(id,name,file);
            } else if("syslog".equals(type)) {
                String host = (String) values.get("host");

                Preconditions.checkArgument(host != null, "syslog host was not given");

                appender = loggingService.createSyslogOutput(id,name);
            } else {
                throw new UnsupportedOperationException("new appenders of type "+type+" not supported");
            }
        }

        appender.setName(name);

        if(level != null) {
            appender.setMaxLevel(Level.toLevel(level));
        }
        if(pattern != null) {
            appender.setPattern(pattern);
        }
        if(values.get("file") != null && appender instanceof LogFileOutput) {
            ((LogFileOutput) appender).setFileName((String) values.get("file"));
        }
        if(values.get("keep") != null && appender instanceof LogFileOutput) {
View Full Code Here

TOP

Related Classes of org.apache.marmotta.platform.core.model.logging.LoggingOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.