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
f6f5fc91
Commit
f6f5fc91
authored
Jul 10, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include logging
parent
2ceddc82
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
122 additions
and
35 deletions
+122
-35
pom.xml
pom.xml
+3
-3
index.html
src/main/webapp/public/index.html
+1
-0
app.js
src/main/webapp/public/scripts/app.js
+20
-4
controllers.js
src/main/webapp/public/scripts/controllers/controllers.js
+23
-4
services.js
src/main/webapp/public/scripts/services/services.js
+34
-4
main.css
src/main/webapp/public/styles/main.css
+11
-1
metrics.html
src/main/webapp/public/views/apps/details/metrics.html
+22
-16
overview.html
src/main/webapp/public/views/apps/overview.html
+7
-3
logback-test.xml
src/test/resources/logback-test.xml
+1
-0
No files found.
pom.xml
View file @
f6f5fc91
...
...
@@ -3,9 +3,9 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin
</artifactId>
<version>
1.0.0.RC
1
</version>
<version>
1.0.0.RC
2
</version>
<properties>
<spring-boot.version>
1.1.
0
.RELEASE
</spring-boot.version>
<spring-boot.version>
1.1.
4
.RELEASE
</spring-boot.version>
<bootstrap.version>
2.3.2
</bootstrap.version>
<jquery.version>
1.11.0
</jquery.version>
<angularjs.version>
1.2.12
</angularjs.version>
...
...
@@ -15,7 +15,7 @@
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-starter-admin-client
</artifactId>
<version>
1.0.0.RC
4
</version>
<version>
1.0.0.RC
5
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
src/main/webapp/public/index.html
View file @
f6f5fc91
...
...
@@ -63,5 +63,6 @@
<script
src=
"/scripts/app.js"
></script>
<script
src=
"/scripts/controllers/controllers.js"
></script>
<script
src=
"/scripts/services/services.js"
></script>
<script
src=
"/scripts/filters/filters.js"
></script>
</body>
</html>
src/main/webapp/public/scripts/app.js
View file @
f6f5fc91
...
...
@@ -34,22 +34,38 @@ angular.module('springBootAdmin', [
.
state
(
'apps.details.infos'
,
{
url
:
'/infos'
,
templateUrl
:
'views/apps/details/infos.html'
,
controller
:
'
i
nfosCtrl'
controller
:
'
detailsI
nfosCtrl'
})
.
state
(
'apps.details.metrics'
,
{
url
:
'/metrics'
,
templateUrl
:
'views/apps/details/metrics.html'
,
controller
:
'
m
etricsCtrl'
controller
:
'
detailsM
etricsCtrl'
})
.
state
(
'apps.details.env'
,
{
url
:
'/env'
,
templateUrl
:
'views/apps/details/env.html'
,
controller
:
'
e
nvCtrl'
controller
:
'
detailsE
nvCtrl'
})
.
state
(
'apps.details.props'
,
{
url
:
'/props'
,
templateUrl
:
'views/apps/details/props.html'
,
controller
:
'propsCtrl'
controller
:
'detailsPropsCtrl'
})
.
state
(
'apps.logging'
,
{
url
:
'/logging/:id'
,
abstract
:
true
,
templateUrl
:
'views/apps/logging.html'
,
controller
:
'detailsCtrl'
})
.
state
(
'apps.logging.read'
,
{
url
:
'/read'
,
templateUrl
:
'views/apps/logging/read.html'
,
controller
:
'loggingReadCtrl'
})
.
state
(
'apps.logging.write'
,
{
url
:
'/write'
,
templateUrl
:
'views/apps/logging/write.html'
,
controller
:
'loggingWriteCtrl'
});
})
.
run
(
function
(
$rootScope
,
$state
,
$stateParams
,
$log
)
{
...
...
src/main/webapp/public/scripts/controllers/controllers.js
View file @
f6f5fc91
...
...
@@ -14,6 +14,10 @@ angular.module('springBootAdmin')
$scope
.
showDetails
=
function
(
id
)
{
$location
.
path
(
'/apps/details/'
+
id
+
'/infos'
);
};
// callback for ng-click 'showLogging':
$scope
.
showLogging
=
function
(
id
)
{
$location
.
path
(
'/apps/logging/'
+
id
+
'/read'
);
};
// callback for ng-click 'refresh':
$scope
.
refresh
=
function
(
id
)
{
$scope
.
application
=
Application
.
query
({
id
:
id
},
function
(
application
)
{
...
...
@@ -30,23 +34,38 @@ angular.module('springBootAdmin')
.
controller
(
'detailsCtrl'
,
function
(
$scope
,
$stateParams
,
Application
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
});
})
.
controller
(
'
i
nfosCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
.
controller
(
'
detailsI
nfosCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
},
function
(
application
)
{
ApplicationDetails
.
getInfo
(
application
);
});
})
.
controller
(
'
m
etricsCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
.
controller
(
'
detailsM
etricsCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
},
function
(
application
)
{
ApplicationDetails
.
getMetrics
(
application
);
});
})
.
controller
(
'
e
nvCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
.
controller
(
'
detailsE
nvCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
},
function
(
application
)
{
ApplicationDetails
.
getEnv
(
application
);
});
})
.
controller
(
'
p
ropsCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
.
controller
(
'
detailsP
ropsCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationDetails
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
},
function
(
application
)
{
ApplicationDetails
.
getProps
(
application
);
});
})
.
controller
(
'loggingCtrl'
,
function
(
$scope
,
$stateParams
,
Application
)
{
$scope
.
application
=
Application
.
query
({
id
:
$stateParams
.
id
});
})
.
controller
(
'loggingReadCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationLogging
)
{
$scope
.
$parent
.
application
.
logger
=
new
Object
();
$scope
.
readLoglevel
=
function
(
application
)
{
ApplicationLogging
.
getLoglevel
(
application
);
};
})
.
controller
(
'loggingWriteCtrl'
,
function
(
$scope
,
$stateParams
,
Application
,
ApplicationLogging
)
{
$scope
.
$parent
.
application
.
logger
=
new
Object
();
$scope
.
writeLoglevel
=
function
(
application
)
{
ApplicationLogging
.
setLoglevel
(
application
);
};
});
src/main/webapp/public/scripts/services/services.js
View file @
f6f5fc91
...
...
@@ -27,13 +27,17 @@ angular.module('springBootAdmin.services', ['ngResource'])
return
$http
.
get
(
app
.
url
+
'/health'
).
success
(
function
(
response
)
{
if
(
typeof
(
response
)
===
'string'
&&
response
.
indexOf
(
'ok'
)
!=
-
1
||
typeof
(
response
.
status
)
===
'string'
&&
(
response
.
status
.
indexOf
(
'ok'
)
!=
-
1
||
response
.
status
.
indexOf
(
'UP'
)
!=
-
1
))
{
app
.
online
=
true
;
(
response
.
status
.
indexOf
(
'ok'
)
!=
-
1
||
response
.
status
.
indexOf
(
'UP'
)
!=
-
1
))
{
app
.
up
=
true
;
}
else
if
(
typeof
(
response
.
status
)
===
'string'
&&
response
.
status
.
indexOf
(
'DOWN'
)
!=
-
1
)
{
app
.
down
=
true
;
}
else
if
(
typeof
(
response
.
status
)
===
'string'
&&
response
.
status
.
indexOf
(
'OUT-OF-SERVICE'
)
!=
-
1
)
{
app
.
outofservice
=
true
;
}
else
{
app
.
online
=
fals
e
;
app
.
unknown
=
tru
e
;
}
}).
error
(
function
()
{
app
.
o
nline
=
fals
e
;
app
.
o
ffline
=
tru
e
;
});
}
this
.
getLogfile
=
function
(
app
)
{
...
...
@@ -80,4 +84,30 @@ angular.module('springBootAdmin.services', ['ngResource'])
}
});
}
}])
.
service
(
'ApplicationLogging'
,
[
'$http'
,
function
(
$http
)
{
this
.
getLoglevel
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/jolokia/exec/ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator/getLoggerLevel/'
+
app
.
logger
.
name
)
.
success
(
function
(
response
)
{
if
(
response
[
'value'
].
length
>
0
)
{
app
.
logger
.
loglevel
=
response
[
'value'
];
}
else
{
app
.
logger
.
loglevel
=
'<unknown>'
;
}
});
}
this
.
setLoglevel
=
function
(
app
)
{
return
$http
.
get
(
app
.
url
+
'/jolokia/exec/ch.qos.logback.classic:Name=default,Type=ch.qos.logback.classic.jmx.JMXConfigurator/setLoggerLevel/'
+
app
.
logger
.
name
+
'/'
+
app
.
logger
.
loglevel
)
.
success
(
function
(
response
)
{
if
(
response
[
'status'
]
==
200
)
{
app
.
logger
.
success
=
true
;
}
else
{
app
.
logger
.
success
=
false
;
}
});
}
}]);
src/main/webapp/public/styles/main.css
View file @
f6f5fc91
...
...
@@ -45,11 +45,20 @@ a:hover.spring-boot-logo span {
opacity
:
1
;
}
span
.
online
{
span
.
up
{
color
:
#00AA00
;
}
span
.offline
{
color
:
#DD0000
;
font-weight
:
bold
;
}
span
.down
,
span
.outofservice
{
color
:
#FF8800
;
font-weight
:
bold
;
}
span
.unknown
{
color
:
#DDDDDD
;
}
\ No newline at end of file
src/main/webapp/public/views/apps/details/metrics.html
View file @
f6f5fc91
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Used Memory
</th>
<th>
Free Memory
</th>
<th>
Processors
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{{ application.metrics['mem'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['mem.free'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['processors'] }}
</td>
</tr>
</tbody>
</table>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Used Memory
</th>
<th>
Free Memory
</th>
<th>
Used Heap
</th>
<th>
Max Heap
</th>
<th>
Processors
</th>
<th>
Uptime
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{{ application.metrics['mem'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['mem.free'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['heap.used'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['heap'] / 1024 | number:2 }} MB
</td>
<td>
{{ application.metrics['processors'] }}
</td>
<td>
{{ application.metrics['uptime'] / 60000 | ceil }}:{{ application.metrics['uptime'] % 60000 / 1000 | ceil }} min
</td>
</tr>
</tbody>
</table>
src/main/webapp/public/views/apps/overview.html
View file @
f6f5fc91
...
...
@@ -21,13 +21,17 @@
<td>
{{ application.id }}
</td>
<td>
{{ application.version }}
</td>
<td>
<span
ng-show=
"application.online"
class=
"online"
>
online
</span>
<span
ng-show=
"!application.online"
class=
"offline"
>
offline
</span>
<span
ng-show=
"application.up"
class=
"up"
>
up
</span>
<span
ng-show=
"application.down"
class=
"down"
>
down
</span>
<span
ng-show=
"application.outofservice"
class=
"oufofservice"
>
out of service
</span>
<span
ng-show=
"application.unknown"
class=
"unknown"
>
unknown
</span>
<span
ng-show=
"application.offline"
class=
"offline"
>
offline
</span>
</td>
<td>
<span
ng-show=
"application.
online
"
style=
"float:right"
>
<span
ng-show=
"application.
up
"
style=
"float:right"
>
<a
ng-show=
"application.providesLogfile"
target=
"_self"
ng-href=
"{{application.urlLogfile}}"
><button
class=
"btn btn-success"
>
Logfile
</button></a>
<button
ng-click=
"showDetails(application.id)"
class=
"btn btn-success"
>
Details
</button>
<button
ng-click=
"showLogging(application.id)"
class=
"btn btn-success"
>
Logging
</button>
<!-- <button ng-click="refresh(application.id)" class="btn btn-success">Refresh</button> -->
</span>
</td>
...
...
src/test/resources/logback-test.xml
View file @
f6f5fc91
...
...
@@ -3,6 +3,7 @@
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<jmxConfigurator/>
<logger
name=
"de.codecentric"
level=
"DEBUG"
/>
<logger
name=
"org.springframework.data"
level=
"INFO"
/>
...
...
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