Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the firehose tracer in RabbitMQ.

For this example, I have a queue called Calculator bound to a headers exchange.

To read the logs using a Java client, I am using the HTTP API to read the log files using this code :

Java
URL url = new URL("http://127.0.0.1:15672/api/trace-files/calculator.log");

HttpURLConnection connection = (HttpURLConnection) url.openConnection();

connection.setRequestMethod("GET");

String userpass = "guest" + ":" + "guest";
String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes());

connection.setRequestProperty("Authorization", basicAuth);
connection.connect();

BufferedReader buff = new BufferedReader(new InputStreamReader(connection.getInputStream()));


Problem is, I want to delete the logs right after I read them since they are no longer needed.

Is there a way to delete the log files contents without affecting the tracing process?

What I have tried:

I tried deleting the log file located in /var/tmp/rabbitmq/, The tracing won't work anymore.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900