Search in sources :

Example 1 with RemoteLoggersResource

use of org.graylog2.rest.resources.system.logs.RemoteLoggersResource in project graylog2-server by Graylog2.

the class ClusterLoggersResource method setSubsystemLoggerLevel.

@PUT
@Timed
@Path("/{nodeId}/subsystems/{subsystem}/level/{level}")
@ApiOperation(value = "Set the loglevel of a whole subsystem", notes = "Provided level is falling back to DEBUG if it does not exist")
@ApiResponses(value = { @ApiResponse(code = 404, message = "No such subsystem.") })
@NoAuditEvent("proxy resource, audit event will be emitted on target nodes")
public void setSubsystemLoggerLevel(@ApiParam(name = "nodeId", required = true) @PathParam("nodeId") @NotEmpty String nodeId, @ApiParam(name = "subsystem", required = true) @PathParam("subsystem") @NotEmpty String subsystemTitle, @ApiParam(name = "level", required = true) @PathParam("level") @NotEmpty String level) throws NodeNotFoundException, IOException {
    final Node node = this.nodeService.byNodeId(nodeId);
    final RemoteLoggersResource remoteLoggersResource = this.remoteInterfaceProvider.get(node, this.authenticationToken, RemoteLoggersResource.class);
    remoteLoggersResource.setSubsystemLoggerLevel(subsystemTitle, level).execute();
}
Also used : Node(org.graylog2.cluster.Node) RemoteLoggersResource(org.graylog2.rest.resources.system.logs.RemoteLoggersResource) Path(javax.ws.rs.Path) Timed(com.codahale.metrics.annotation.Timed) ApiOperation(io.swagger.annotations.ApiOperation) PUT(javax.ws.rs.PUT) ApiResponses(io.swagger.annotations.ApiResponses) NoAuditEvent(org.graylog2.audit.jersey.NoAuditEvent)

Aggregations

Timed (com.codahale.metrics.annotation.Timed)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiResponses (io.swagger.annotations.ApiResponses)1 PUT (javax.ws.rs.PUT)1 Path (javax.ws.rs.Path)1 NoAuditEvent (org.graylog2.audit.jersey.NoAuditEvent)1 Node (org.graylog2.cluster.Node)1 RemoteLoggersResource (org.graylog2.rest.resources.system.logs.RemoteLoggersResource)1