Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
praxis-core
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
praxis
praxis-core
Commits
bf26e45e
Verified
Commit
bf26e45e
authored
6 years ago
by
BIGARET Sebastien
Browse files
Options
Downloads
Patches
Plain Diff
Fix: app. crashed if no logging.properties can be found
parent
d8b9f6fb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES
+3
-0
3 additions, 0 deletions
CHANGES
src/eu/telecom_bretagne/praxis/common/Configuration.java
+19
-6
19 additions, 6 deletions
src/eu/telecom_bretagne/praxis/common/Configuration.java
with
22 additions
and
6 deletions
CHANGES
+
3
−
0
View file @
bf26e45e
- Fix a bug causing an application to crash if no logging.properties
could be found (*sigh*)
v3.0.1
------
...
...
This diff is collapsed.
Click to expand it.
src/eu/telecom_bretagne/praxis/common/Configuration.java
+
19
−
6
View file @
bf26e45e
...
...
@@ -95,7 +95,12 @@ public final class Configuration
}
catch
(
Throwable
e
)
// catch all, yes we mean it!
{
Log
.
log
.
log
(
Level
.
SEVERE
,
"Could not load the configuration file, exiting"
,
e
);
final
String
err
=
"Could not load the configuration file, exiting"
;
Log
.
log
.
log
(
Level
.
SEVERE
,
err
,
e
);
// it is severe enough to print it on the stderr as well
System
.
err
.
println
(
err
);
e
.
printStackTrace
(
System
.
err
);
System
.
exit
(-
1
);
}
}
...
...
@@ -652,10 +657,11 @@ public final class Configuration
try
{
// is there a logging.properties in the current directory?
if
(
new
File
(
"logging.properties"
).
isFile
())
final
String
loggingPropertiesPathname
=
"logging.properties"
;
if
(
new
File
(
loggingPropertiesPathname
).
isFile
())
try
{
loggingProperties
=
new
FileInputStream
(
new
File
(
"
logging
.p
roperties
"
));
loggingProperties
=
new
FileInputStream
(
new
File
(
logging
P
roperties
Pathname
));
}
catch
(
FileNotFoundException
e
)
{
...
...
@@ -667,7 +673,7 @@ public final class Configuration
// nothing in the current dir, let's search our class path
try
{
final
URL
url
=
FileResources
.
url
(
"
logging
.p
roperties
"
);
final
URL
url
=
FileResources
.
url
(
logging
P
roperties
Pathname
);
loggingProperties
=
url
.
openStream
();
}
...
...
@@ -678,9 +684,16 @@ public final class Configuration
}
try
{
Log
.
log
.
info
(
"Reinitializing the logging properties"
);
if
(
loggingProperties
!=
null
)
{
Log
.
log
.
info
(
"Resetting the log manager"
);
LogManager
.
getLogManager
().
readConfiguration
(
loggingProperties
);
}
else
{
Log
.
log
.
info
(()->
"No need to reset the log manager, file "
+
loggingPropertiesPathname
+
" not found"
);
}
}
catch
(
SecurityException
e
)
{
error
=
"Could not reinitialize the logging properties (SecurityException)"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment