Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen...
-
Upload
kayli-nott -
Category
Documents
-
view
213 -
download
0
Transcript of Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen...
![Page 1: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/1.jpg)
Distributed Logging in Javawith Constrained Resource Usage
Sunil Brown Varghese, Daniel Andresen
Dept. of Computing and Information Sciences
Kansas State University
![Page 2: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/2.jpg)
Overview
Introduction to Logging Distributed Logging Distributed Logging with RMI Conclusions
![Page 3: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/3.jpg)
Introduction
Everyone logs in one way or other… print(), out, System.out.print() are examples
of console logging Large systems like aircraft monitoring
systems, transaction–based financial processes may log into multiple targets
![Page 4: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/4.jpg)
Advantages of Logging
Feedback to developers during development cycles
Provide system diagnostic alerts from production systems
Provide information for statistical analysis of working of a system
Delivery based on levels of importance could improve efficiency in development cycle
![Page 5: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/5.jpg)
Logging options
The Log4J Project Logging Toolkit for Java from IBM Java 2 Standard Edition (v1.4.0 onward)
![Page 6: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/6.jpg)
Distributed Logging
![Page 7: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/7.jpg)
Distributed Logging
Log4j has good support for sending log messages to multiple log servers by TCP/IP socket connections
J2SE provides the Java Logging framework by default and supports distribution of log messages by socket connections (though listeners are left to the developer)
![Page 8: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/8.jpg)
Java Logging Framework
![Page 9: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/9.jpg)
Observation effects the Observed
If generated at a high rate, distributed log messages may swamp the processor and the network connections whereby decreasing system performance and the accuracy of the log analysis
Solution: Limit the use of distributed log messages to critical and non-repetitive sections of code and buffer messages
![Page 10: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/10.jpg)
Distributed Logging with RMI
Transmission of Log messages with RMI calls allows the log objects to be recorded at remote sites as is
Log messages may be modified easily ( say based on network load, exception objects may be removed from log)
![Page 11: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/11.jpg)
Representation
![Page 12: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/12.jpg)
Extending the Java Logging Framework
RMI Handler extended from Handler class ensuring compatibility with Logger and security in-built into Java Logging
The logging levels may be varied dynamically against bandwidth usage by providing level information in an XML file
![Page 13: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/13.jpg)
Class View – Client Side
![Page 14: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/14.jpg)
Class View – Server Side
![Page 15: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/15.jpg)
Sample Levels.xml file
<?xml version='1.0'?> <param-list> <cutoff>1600</cutoff> <cutoff>1400</cutoff> <cutoff>1200</cutoff> <cutoff>1000</cutoff> <cutoff>800</cutoff> <cutoff>600</cutoff> <cutoff>500</cutoff> </param-list>
![Page 16: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/16.jpg)
RMI Log Server
Instantiates a logger and assigns the RMI Handler and other Handlers based on an XML file
Server binds to the specified machine and port (binding data from input XML file)
This framework allows a chain of RMI Servers to be formed connected by RMI Handlers in a tree fashion
![Page 17: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/17.jpg)
Bandwidth Computation
TCP/IP based weighted average method is used to update bandwidth
Bandwidth is sampled for a Sampling Time and it is reset for a fresh start
If there is no bandwidth updates for an Inactivity Tolerance period, the Bandwidth is reset
![Page 18: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/18.jpg)
RMI Log Buffer
The RMI Handler may buffer the log messages so as to reduce the number of RMI calls needed. This could dramatically raise the efficiency of transmission
The RMI Buffer ensures message transmission under normal RMI Handler operation and abnormal termination
![Page 19: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/19.jpg)
RMI Log Server GUI
The GUI connects to RMI Log Server and provides time graphs of bandwidth statistics
The cutoffs along with bandwidth variance are shown
![Page 20: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/20.jpg)
RMI Log Server GUI
![Page 21: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/21.jpg)
RMI Log Server GUI Connection
As there isn’t a unique naming scheme for RMI Handlers connected to a logger, the URL and port information is used as RMI Handler identifier
![Page 22: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/22.jpg)
RMI Log Server GUI Connection
![Page 23: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/23.jpg)
Limitations / Assumptions
Leveling thresholds at the RMI Handler level are to be set intuitively by the user
Log message sizes were taken as constants for testing purposes
The overhead of making an RMI call is heavier than sending data through TCP/IP sockets
![Page 24: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/24.jpg)
Conclusions
RMI Logging allows the recreation of log messages in remote sites as long as all sub-components are serializable
Allows the exception objects to be stored in remote repositories
RMI Handler can monitor its bandwidth usage and discard log messages of low level
![Page 25: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/25.jpg)
Future work
RMI Handler may maintain a server list so that if one RMI Log Server fails, it retransmits to secondary servers
The GUI interface can be developed further to remotely control RMI Log Servers
![Page 26: Distributed Logging in Java with Constrained Resource Usage Sunil Brown Varghese, Daniel Andresen Dept. of Computing and Information Sciences Kansas State.](https://reader035.fdocuments.in/reader035/viewer/2022062713/56649cba5503460f94981d21/html5/thumbnails/26.jpg)
Questions ?