Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
joram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joram
joram
Commits
004b6e8c
Commit
004b6e8c
authored
Jun 04, 2002
by
Jeff Mesnil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this class now extends fr.dyade.aaa.util.Debug
parent
79e7c839
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
95 deletions
+1
-95
joram/src/fr/dyade/aaa/agent/Debug.java
joram/src/fr/dyade/aaa/agent/Debug.java
+1
-95
No files found.
joram/src/fr/dyade/aaa/agent/Debug.java
View file @
004b6e8c
...
...
@@ -59,91 +59,7 @@ import org.objectweb.util.monolog.api.LoggerFactory;
* <p>
* Currently only boolean variables may be dynamically set this way.
*/
public
final
class
Debug
{
/** RCS version number of this file: $Revision: 1.10 $ */
public
static
final
String
RCS_VERSION
=
"@(#)$Id: Debug.java,v 1.10 2002-05-27 15:17:12 jmesnil Exp $"
;
/** directory holding the debug files */
public
static
File
directory
=
null
;
static
LoggerFactory
factory
=
null
;
/** Property name for A3 debug configuration directory */
public
final
static
String
DEBUG_DIR_PROPERTY
=
"fr.dyade.aaa.agent.A3DEBUG_DIR"
;
/** Default directory for A3 debug configuration file */
public
final
static
String
DEFAULT_DEBUG_DIR
=
"."
;
/** Property name for A3 debug configuration filename */
public
final
static
String
DEBUG_FILE_PROPERTY
=
"fr.dyade.aaa.agent.A3DEBUG_FILE"
;
/** Default filename for A3 debug configuration */
public
final
static
String
DEFAULT_DEBUG_FILE
=
"a3debug.cfg"
;
/** Property name for A3 debug produced files */
public
final
static
String
AUDIT_DIR_PROPERTY
=
"fr.dyade.aaa.agent.A3AUDIT_DIR"
;
/** Default directory for A3 debug produced files */
public
final
static
String
DEFAULT_AUDIT_DIR
=
"."
;
/**
* Initializes the package.
* Creates and/or opens the debug trace file, sets the debug variables
* from the debug property file.
*
* @param serverId this server id
*/
public
static
void
init
(
short
serverId
)
{
boolean
basic
=
false
;
String
debugDir
=
System
.
getProperty
(
DEBUG_DIR_PROPERTY
,
DEFAULT_DEBUG_DIR
);
String
debugFileName
=
System
.
getProperty
(
DEBUG_FILE_PROPERTY
,
DEFAULT_DEBUG_FILE
);
File
debugFile
=
new
File
(
debugDir
,
debugFileName
);
// Instanciate the MonologLoggerFactory
factory
=
(
LoggerFactory
)
new
MonologLoggerFactory
();
if
((
debugFile
==
null
)
||
(!
debugFile
.
exists
())
||
(!
debugFile
.
isFile
())
||
(
debugFile
.
length
()
==
0
))
{
try
{
((
MonologLoggerFactory
)
factory
).
configure
(
null
);
basic
=
true
;
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Unable to configure monolog wrapper"
);
System
.
exit
(
1
);
}
}
else
{
try
{
Properties
prop
=
new
Properties
();
prop
.
put
(
"log4jConfiguration"
,
"property"
);
prop
.
put
(
"log4jConfigurationFile"
,
debugDir
+
"/"
+
debugFileName
);
((
MonologLoggerFactory
)
factory
).
configure
(
prop
);
}
catch
(
Exception
exc
)
{
try
{
((
MonologLoggerFactory
)
factory
).
configure
(
null
);
basic
=
true
;
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Unable to configure monolog wrapper"
);
System
.
exit
(
1
);
}
}
}
Category
root
=
Category
.
getRoot
();
if
(
basic
)
{
root
.
setPriority
(
org
.
apache
.
log4j
.
Priority
.
ERROR
);
}
else
if
(
serverId
>=
0
)
{
try
{
String
auditDir
=
System
.
getProperty
(
AUDIT_DIR_PROPERTY
,
DEFAULT_AUDIT_DIR
);
// Try to create local appender if defined...
FileAppender
local
=
(
FileAppender
)
root
.
getAppender
(
"local"
);
File
auditFile
=
new
File
(
auditDir
,
"server#"
+
serverId
+
".audit"
);
local
.
setFile
(
auditFile
.
getCanonicalPath
());
}
catch
(
Exception
exc
)
{
}
}
}
public
final
class
Debug
extends
fr
.
dyade
.
aaa
.
util
.
Debug
{
// sets dynamic debug variables for other packages
// final String dynvarMarker = "Debug.var.";
// int markerLength = dynvarMarker.length();
...
...
@@ -196,23 +112,13 @@ public final class Debug {
// }
// }
static
final
boolean
debug
=
true
;
public
static
final
String
A3Debug
=
"fr.dyade.aaa.agent"
;
public
static
final
String
A3Agent
=
A3Debug
+
".Agent"
;
public
static
final
String
A3Engine
=
A3Debug
+
".Engine"
;
public
static
final
String
A3Network
=
A3Debug
+
".Network"
;
public
static
final
String
A3Service
=
A3Debug
+
".Service"
;
public
static
final
String
A3Daemon
=
A3Debug
+
".Daemon"
;
public
static
final
String
A3Proxy
=
A3Agent
+
".ProxyAgent"
;
public
static
Logger
getLogger
(
String
topic
)
{
if
(
factory
==
null
)
init
((
short
)
-
1
);
return
factory
.
getLogger
(
topic
);
}
// static void dump(byte[] buf, int size) {
// int idx = 0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment