FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
esapi-java-legacy/src/examples/java/ESAPILogging.java at develop · ESAPI/esapi-java-legacy · GitHub
ESAPI
esapi-java-legacy
Repository navigation
Code
Issues
127
(127)
Pull requests
9
(9)
Discussions
Actions
Projects
Wiki
Security and quality
4
(4)
Insights
Expand file tree
Breadcrumbs
esapi-java-legacy
/
src
/
examples
/
java
/
ESAPILogging.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (19 loc) · 790 Bytes
Breadcrumbs
esapi-java-legacy
/
src
/
examples
/
java
/
ESAPILogging.java
Copy path
File metadata and controls
23 lines (19 loc) · 790 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import
org
.
owasp
.
esapi
.
ESAPI
;
import
org
.
owasp
.
esapi
.
Logger
;
// Purpose: Short code snippet to show how ESAPI logging works.
//
// Usage: java -classpath <cp> ESAPILogging
// where <cp> is proper classpath, which minimally includes the esapi.jar.
public
class
ESAPILogging
{
public
static
void
main
(
String
[]
args
) {
try
{
Logger
logger
=
ESAPI
.
getLogger
(
"ESAPILogging"
);
logger
.
warning
(
Logger
.
SECURITY_FAILURE
,
"This is a warning."
);
logger
.
always
(
Logger
.
SECURITY_AUDIT
,
"This is an audit log. It always logs."
);
}
catch
(
Throwable
t
) {
System
.
err
.
println
(
"Caught: "
+
t
.
getClass
().
getName
() +
"; exception msg: "
+
t
);
t
.
printStackTrace
(
System
.
err
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL