Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
30d76a73
Commit
30d76a73
authored
Nov 10, 2016
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging statements
parent
ebd94f0c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
2 deletions
+23
-2
ApplicationDiscoveryListener.java
...ic/boot/admin/discovery/ApplicationDiscoveryListener.java
+3
-0
DefaultServiceInstanceConverter.java
...boot/admin/discovery/DefaultServiceInstanceConverter.java
+8
-0
ConcatenatingResourceResolver.java
...n/web/servlet/resource/ConcatenatingResourceResolver.java
+3
-0
PreferMinifiedFilteringResourceResolver.java
...let/resource/PreferMinifiedFilteringResourceResolver.java
+5
-2
ResourcePatternResolvingResourceResolver.java
...et/resource/ResourcePatternResolvingResourceResolver.java
+4
-0
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/ApplicationDiscoveryListener.java
View file @
30d76a73
...
@@ -84,6 +84,8 @@ public class ApplicationDiscoveryListener {
...
@@ -84,6 +84,8 @@ public class ApplicationDiscoveryListener {
String
applicationId
=
register
(
instance
);
String
applicationId
=
register
(
instance
);
staleApplicationIds
.
remove
(
applicationId
);
staleApplicationIds
.
remove
(
applicationId
);
}
}
}
else
{
LOGGER
.
debug
(
"Ignoring discovered service {}"
,
serviceId
);
}
}
}
}
for
(
String
staleApplicationId
:
staleApplicationIds
)
{
for
(
String
staleApplicationId
:
staleApplicationIds
)
{
...
@@ -107,6 +109,7 @@ public class ApplicationDiscoveryListener {
...
@@ -107,6 +109,7 @@ public class ApplicationDiscoveryListener {
try
{
try
{
Application
application
=
converter
.
convert
(
instance
);
Application
application
=
converter
.
convert
(
instance
);
if
(
application
!=
null
)
{
if
(
application
!=
null
)
{
LOGGER
.
debug
(
"Registering discovered application {}"
,
application
);
return
registry
.
register
(
application
).
getId
();
return
registry
.
register
(
application
).
getId
();
}
else
{
}
else
{
LOGGER
.
warn
(
"No application for service {} registered"
,
instance
);
LOGGER
.
warn
(
"No application for service {} registered"
,
instance
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/discovery/DefaultServiceInstanceConverter.java
View file @
30d76a73
...
@@ -20,6 +20,8 @@ import static org.apache.commons.lang.StringUtils.stripStart;
...
@@ -20,6 +20,8 @@ import static org.apache.commons.lang.StringUtils.stripStart;
import
java.net.URI
;
import
java.net.URI
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.web.util.UriComponentsBuilder
;
import
org.springframework.web.util.UriComponentsBuilder
;
...
@@ -35,6 +37,8 @@ import de.codecentric.boot.admin.model.Application;
...
@@ -35,6 +37,8 @@ import de.codecentric.boot.admin.model.Application;
* @author Johannes Edmeier
* @author Johannes Edmeier
*/
*/
public
class
DefaultServiceInstanceConverter
implements
ServiceInstanceConverter
{
public
class
DefaultServiceInstanceConverter
implements
ServiceInstanceConverter
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
DefaultServiceInstanceConverter
.
class
);
private
static
final
String
KEY_MANAGEMENT_PORT
=
"management.port"
;
private
static
final
String
KEY_MANAGEMENT_PORT
=
"management.port"
;
private
static
final
String
KEY_MANAGEMENT_PATH
=
"management.context-path"
;
private
static
final
String
KEY_MANAGEMENT_PATH
=
"management.context-path"
;
private
static
final
String
KEY_HEALTH_PATH
=
"health.path"
;
private
static
final
String
KEY_HEALTH_PATH
=
"health.path"
;
...
@@ -43,6 +47,10 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
...
@@ -43,6 +47,10 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
@Override
@Override
public
Application
convert
(
ServiceInstance
instance
)
{
public
Application
convert
(
ServiceInstance
instance
)
{
LOGGER
.
debug
(
"Converting service '{}' running at '{}' with metadata {}"
,
instance
.
getServiceId
(),
instance
.
getUri
(),
instance
.
getMetadata
());
Application
.
Builder
builder
=
Application
.
create
(
instance
.
getServiceId
());
Application
.
Builder
builder
=
Application
.
create
(
instance
.
getServiceId
());
URI
healthUrl
=
getHealthUrl
(
instance
);
URI
healthUrl
=
getHealthUrl
(
instance
);
if
(
healthUrl
!=
null
)
{
if
(
healthUrl
!=
null
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/web/servlet/resource/ConcatenatingResourceResolver.java
View file @
30d76a73
...
@@ -51,6 +51,9 @@ public class ConcatenatingResourceResolver extends AbstractResourceResolver {
...
@@ -51,6 +51,9 @@ public class ConcatenatingResourceResolver extends AbstractResourceResolver {
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
String
filename
=
StringUtils
.
getFilename
(
requestPath
);
String
filename
=
StringUtils
.
getFilename
(
requestPath
);
try
{
try
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Creating concatenated resource '"
+
filename
+
"' from "
+
locations
);
}
return
new
InMemoryFileResource
(
filename
,
buildDescription
(
locations
),
return
new
InMemoryFileResource
(
filename
,
buildDescription
(
locations
),
getContent
(
locations
),
getLastModified
(
locations
));
getContent
(
locations
),
getLastModified
(
locations
));
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/web/servlet/resource/PreferMinifiedFilteringResourceResolver.java
View file @
30d76a73
...
@@ -33,7 +33,6 @@ import org.springframework.web.servlet.resource.ResourceResolverChain;
...
@@ -33,7 +33,6 @@ import org.springframework.web.servlet.resource.ResourceResolverChain;
* @author Johannes Edmeier
* @author Johannes Edmeier
*/
*/
public
class
PreferMinifiedFilteringResourceResolver
extends
AbstractResourceResolver
{
public
class
PreferMinifiedFilteringResourceResolver
extends
AbstractResourceResolver
{
private
final
String
extensionPrefix
;
private
final
String
extensionPrefix
;
public
PreferMinifiedFilteringResourceResolver
(
String
extensionPrefix
)
{
public
PreferMinifiedFilteringResourceResolver
(
String
extensionPrefix
)
{
...
@@ -43,7 +42,7 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
...
@@ -43,7 +42,7 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
@Override
@Override
protected
Resource
resolveResourceInternal
(
HttpServletRequest
request
,
String
requestPath
,
protected
Resource
resolveResourceInternal
(
HttpServletRequest
request
,
String
requestPath
,
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
List
<
Resource
>
newLocations
=
new
ArrayList
<
Resource
>(
locations
.
size
());
List
<
Resource
>
newLocations
=
new
ArrayList
<>(
locations
.
size
());
for
(
Resource
location
:
locations
)
{
for
(
Resource
location
:
locations
)
{
Resource
minified
=
findMinified
(
location
);
Resource
minified
=
findMinified
(
location
);
...
@@ -60,6 +59,10 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
...
@@ -60,6 +59,10 @@ public class PreferMinifiedFilteringResourceResolver extends AbstractResourceRes
Resource
minified
=
resource
Resource
minified
=
resource
.
createRelative
(
basename
+
extensionPrefix
+
'.'
+
extension
);
.
createRelative
(
basename
+
extensionPrefix
+
'.'
+
extension
);
if
(
minified
.
exists
())
{
if
(
minified
.
exists
())
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Found minified file for '"
+
resource
.
getFilename
()
+
"': '"
+
minified
.
getFilename
()
+
"'"
);
}
return
minified
;
return
minified
;
}
}
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/web/servlet/resource/ResourcePatternResolvingResourceResolver.java
View file @
30d76a73
...
@@ -50,6 +50,10 @@ public class ResourcePatternResolvingResourceResolver extends AbstractResourceRe
...
@@ -50,6 +50,10 @@ public class ResourcePatternResolvingResourceResolver extends AbstractResourceRe
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
List
<?
extends
Resource
>
locations
,
ResourceResolverChain
chain
)
{
try
{
try
{
Resource
[]
resources
=
resourcePatternResolver
.
getResources
(
pattern
);
Resource
[]
resources
=
resourcePatternResolver
.
getResources
(
pattern
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Resolved Resources for '"
+
pattern
+
"': "
+
Arrays
.
toString
(
resources
));
}
return
chain
.
resolveResource
(
request
,
requestPath
,
Arrays
.
asList
(
resources
));
return
chain
.
resolveResource
(
request
,
requestPath
,
Arrays
.
asList
(
resources
));
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
throw
new
ResourceAccessException
(
"Couldn't resolve resources for \""
+
pattern
+
"\""
,
throw
new
ResourceAccessException
(
"Couldn't resolve resources for \""
+
pattern
+
"\""
,
...
...
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