- private void removeHandlers() throws SecurityException, IOException {
- String loggerName;
- Logger logger;
-
- Enumeration list = this.logManager.getLoggerNames();
- while (list.hasMoreElements()) {
- loggerName = list.nextElement().toString();
- /* Somehow there is always an empty string at the end. */
- if (loggerName == "") {
- continue;
- }
-
- logger = this.logManager.getLogger(loggerName);
- logger.removeHandler(this.lttngHandlerUser);
- logger.removeHandler(this.lttngHandlerRoot);
- }
- }
-
- private int getUID() throws IOException {
- int uid;
- byte b[] = new byte[4];
- String userName = System.getProperty("user.name");
- String command = "id -u " + userName;
- Process child = Runtime.getRuntime().exec(command);
- InputStream in = child.getInputStream();
-
- in.read(b);
- uid = Integer.parseInt(new String(b).trim(), 10);
- in.close();
-
- return uid;
- }
-