Title: DEV22: Youve got a problem, heres how to find it
1DEV-22 Youve got a problem, heres how to find
it
- Troubleshooting and debugging your application
Tomas Kucera
Principal Solution Engineer
2Session Goals
- Learn how to troubleshoot situations that you
might find yourself in - See tools and techniques used for addressing
those situations - Debugger
- Logging infrastructure
3Agenda
- Diagnosis
- Bugs
- Memory leaks
- Performance
- The Debugger
- Other tools
- Logging framework
- Profiler
- Compiler
4Diagnosis
You know youve got problems when
- Your application
- Doesnt do what its supposed to
- Does things it shouldnt
- Runs slower and slower over time
- Queries and reports take a long time
- Good performance with thick client, not with thin
client - Performance gets worse with more users
5Diagnosis
Know your enemy
- Bugs
- Incomplete, incorrect code
- Inefficient resource usage
- Memory leaks
- Performance
- Query optimization
- Roundtrip optimization
- Network traffic
- Scalability
6Agenda
- Diagnosis
- Bugs
- Memory leaks
- Performance
- The Debugger
- Other tools
- Logging framework
- Compiler
7The Debugger
- Java graphical interface
- Supports local and remote debugging
- Supported on all platforms that support Java
- First official release OpenEdge 10.0A
- First integrated into OpenEdge Architect in 10.1A
8Debugger NOT enabled by default
Attachable debugger a potential security risk
9Debugger Variants
- OpenEdge Debugger Perspective
- First release 10.1A
- Re-tooled in 10.1B
- Eclipse Debug Framework integration
- GUI Debugger
- Launched from running ABL code, or
- Attach to running AVM session
10The OpenEdge Debugger Perspective
- Use editor actions during debugging
- Persists breakpoints and settings
- Multiple concurrent debug sessions
- Uses source, not compiler listings
- Can add missing source code
- Simplified inspection of complex objects
11The GUI Debugger
- AppBuilder or Procedure Editor
- Compile ? Debug
- Can step into AppServer code from Client session
- Programmatically
- DEBUGGER system handle
- Initiate debugging in AppServer or WebSpeed code
- MESSAGE statement
DEBUGGERINITIATE().DEBUGGERSET-BREAK().
-debugalert
12Demo OE Architect Debugger
13Agenda
- Diagnosis
- Bugs
- Memory leaks
- Performance
- The Debugger
- Other tools
- Logging framework
- Profiler
- Compiler
14Logging Infrastructure
- Why log?
- Report standard run-time activity
- Log diagnostic data for troubleshooting
- Data written to log file
- Control content using log types and levels
- Unified log file format
- Log file management (size, number)
- Available for all ABL clients
15Logging Set-up
- LOG-MANAGER handle
- Run-time GUI or Character client
- AppServer or WebSpeed agent
- Progress Explorer
- AppServer, AIA, WebSpeed, Unified Broker,
NameServer - Separate broker and server logs
- Startup parameters
- GUI or Character client
16Log Entry Types
- 4GL Interpreter
- 4GLTrace
- 4GLTrans
- DB.Connects
- DynObjects.
- FileId
- QryInfo
- SAX
- ProEvents.
-logentrytypes DynObjects.DB,QryInfo
17Logging Levels
- 0 None
- 1 Errors
- 2 Basic
- 3 Verbose
- 4 Extended
-logginglevel 2
18Log File Management
- Specify log file name
- Specify size of log file
- Specify number of files to keep
- Rolled-over log file names
-clientlog myLog.log
-logthreshold 536870912
Size in BYTES
-numlogfiles 8
filename..extension
-rw-rw-r-- pjudge 536870912 Mar30
myLog.000001.log -rw-rw-r-- pjudge 536870912 Apr
1 myLog.000002.log -rw-rw-r-- pjudge 2451
Apr 2 myLog.log
19Log File Archaeology with LogRead
- Log files (can) produce a lot of data
- Not always easy to read
- LogRead is a GUI utility for log files
- View, manipulate, filter, sort, merge translate
- Written in ABL
- Extensible Add custom log handlers
- Not officially supported
- Available on PSDN
- On-line Help
20What can LogRead do?
- Loads log files from many sources versions
- Merge multiple logs
- Filtering of noise from logs
- Localization
- Date formats, code pages
- Translation of PROMSGS
- Sorting and searching
- Timestamp adjustment
21Demo Logging LogRead
22Other tools
- ProSpy Plus
- Execution logs
- Profiler
- Execution timings
- Compiler
- COMPILER XREF option
- Other 3rd party
23ProSpy Plus
- Traces actual ABL program execution
- Uses SESSIONEXECUTION-LOG
- Logs from the RUN perspective
- Only trace pertinent parts
- Turn tracing on and off at will
- Results displayed in treeview
- Allows drill-down
- Shows event types, names, locations
24Profiler
- Profile and analyze performance data
- Data gathered using PROFILER system handle
- Profiler is a GUI Tool
- Shows procedure, function timings
- Temp-table based
- Drill-down through execution stack
- Allows side-by-side comparisons
- Export data to external programs
25Other tools
- The Compiler as diagnostic tool
- INDEX-INFORMATION query attribute
- COMPILE XREF statement
- Network analysis
- Packet sniffing
Now with XML
26Demo ProSpy, Profiler, etc
27In Summary
- Saw different kinds of problems you might
encounter - Looked at various tools used to solve those
problems - Debugger
- Logging framework
- Profiler
- ProSpy Plus
28For More Information, go to
- PSDN
- Profiler
- http//www.psdn.com/library/entry.jspa?categoryID
41externalID280 - ProSpy Plus
- http//www.psdn.com/library/entry.jspa?categoryID
83externalID388 - LogRead 1.0 Tool Overview (English Spanish)
- http//www.psdn.com/library/entry.jspa?categoryID
62externalID1841 - Log Read Utility
- http//www.psdn.com/library/entry.jspa?categoryID
41externalID349 - Documentation
- OpenEdge Development Debugging and
Troubleshooting - OpenEdge Deployment Startup Command and
Parameter Reference
29Questions?
30Thank you foryour time
31(No Transcript)