logo
down
shadow

docker compose spring boot logs


docker compose spring boot logs

By : Asiel
Date : October 16 2020, 03:08 PM
around this issue There was nothing wrong with the logging, the issue was with my docker-compose.yml file. I needed to link the database correctly.
docker-compose.yml:
code :
version: '3'

services:

  database:
    image: mysql:5.7
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
      MYSQL_USER: root
      MYSQL_DATABASE: pensionator
    ports:
      - '3307:3306'
    restart: always

  appserver:
    build:
      context: .
      dockerfile: src/main/docker/Dockerfile
    depends_on:
      - database
    image: pensionator_app
    environment:
      SPRING_DATASOURCE_URL: 'jdbc:mysql://database:3306/pensionator'
    links:
      - database
    ports:
      - '8080:8080'
      - '8000:8000'
    restart: always


Share : facebook icon twitter icon
Spring Boot and Docker-compose setting arguments

Spring Boot and Docker-compose setting arguments


By : Jenny Ryan
Date : March 29 2020, 07:55 AM
I wish this helpful for you At the time you build the dockerfile, you must add this parameter
docker build --build-arg JAR_FILE=jar_file_path .
code :
version: '3'
services:
   web:
      build:
        context: ./
        args:
          JAR_FILE: jar_file_path
      ports:
        - "8188:8188"
Spring boot - Docker logs

Spring boot - Docker logs


By : Joseph Pipero
Date : March 29 2020, 07:55 AM
Hope that helps I have a spring boot java application running inside a docker container. I configured logback in the application. Where i can access the generated logs? The configured path is: , I am using the following way: in logback.xml:
code :
<?xml version="1.0" encoding="UTF-8"?>
<property name="LOG_PATH" value="logs"/>
<timestamp key="currentTimestamp" datePattern="yyyy-MM-dd'_'HH"/>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>
            %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M\(%line\) - %msg%n
        </pattern>
    </encoder>
</appender>

<appender name="SAVE-TO-FILE"
          class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${LOG_PATH}/appName.log</file>
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <Pattern>
            %d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M - %msg%n
        </Pattern>
    </encoder>

    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
        <!-- the rollover occurs when the active log file reaches the maximum file size before the end of the time period. -->
        <!-- The rollover period is inferred from the smallest date unit value of fileNamePattern -->
        <!-- each file should be at most [maxFileSize], keep [maxHistory] days worth of history, but at most [totalSizeCap] -->
        <maxFileSize>100MB</maxFileSize>
        <fileNamePattern>
            ${LOG_PATH}/archived/appName.%d{yyyy-MM-dd}.%i.log
        </fileNamePattern>
        <maxHistory>30</maxHistory>
        <totalSizeCap>1GB</totalSizeCap>
    </rollingPolicy>
</appender>


<root level="INFO">
    <appender-ref ref="STDOUT"/>
    <appender-ref ref="SAVE-TO-FILE"/>
</root>
docker run --network name-network --restart=unless-stopped --name name-java-container 
--hostname valueOfHostname -d -p 8080:8080 \
-v /data/nameFolderForLogs:/logs \
imageName
Run multiple Spring-Boot apps with Docker-Compose

Run multiple Spring-Boot apps with Docker-Compose


By : Mr. Gladref
Date : March 29 2020, 07:55 AM
To fix this issue The Spring-Boot applications try to connect to localhost:3306. This works fine as long as they do not run within a container.
When running within the container the connection is also tried to establish against localhost (but this time within the spring-boot docker container). This fails, obviously, as within your spring-boot container there is no mysql running.
code :
spring.datasource.url=jdbc:mysql://database:3306/webDatabase?autoReconnect=true&useSSL=false
Docker-compose: Issue while running the spring boot enabled and spring cloud config application

Docker-compose: Issue while running the spring boot enabled and spring cloud config application


By : M. Baker
Date : March 29 2020, 07:55 AM
To fix the issue you can do There are multiple errors.
Make sure that you only use spaces for indentation (instead of tabs). If you are interested why tabs don't work within yaml files have a look at A YAML file cannot contain tabs as indentation put your ports into strings (e.g. - "8060:8060"instead of - 8060:8060) I think you are misusing environment variables. They should/must look like e.g.:
Docker-compose - Providing XML based configuration to docker container running spring boot standalone application

Docker-compose - Providing XML based configuration to docker container running spring boot standalone application


By : user3057731
Date : March 29 2020, 07:55 AM
This might help you
I expect this should create the directory, copy the default services.xml (along with all other files in /opt/lib/my-app/lib/conf) in container into this directory to make it available for me to edit.
code :
version: '3'
services:
  frontend:
    image: alpine
    command: "tail -f /dev/null"
    volumes:
      - my_data:/etc

volumes:
  my_data:
shubuntu1@shubuntu1:~/77$ docker-compose up -d
Creating network "77_default" with the default driver
Creating volume "77_my_data" with default driver
Creating 77_frontend_1 ... done
shubuntu1@shubuntu1:~/77$ docker ps
CONTAINER ID    IMAGE     COMMAND               CREATED             STATUS          PORTS     NAMES
6635aba545c9    alpine    "tail -f /dev/null"   14 minutes ago      Up 14 minutes             77_frontend_1
shubuntu1@shubuntu1:~/77$ docker inspect 77_frontend_1 | grep Source
            "Source": "/var/lib/docker/volumes/77_my_data/_data",
shubuntu1@shubuntu1:~/77$ docker exec 77_frontend_1 cat /etc/profile
export CHARSET=UTF-8
export LANG=C.UTF-8
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PAGER=less
export PS1='\h:\w\$ '
umask 022

for script in /etc/profile.d/*.sh ; do
    if [ -r $script ] ; then
            . $script
    fi
done
shubuntu1@shubuntu1:~/77$ sudo -s -H
root@shubuntu1:/home/shubuntu1/77# cd /var/lib/docker/volumes/77_my_data/_data
root@shubuntu1:/var/lib/docker/volumes/77_my_data/_data# echo 'echo "hello"' >> profile
shubuntu1@shubuntu1:~/77$ docker exec 77_frontend_1 cat /etc/profile
export CHARSET=UTF-8
export LANG=C.UTF-8
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PAGER=less
export PS1='\h:\w\$ '
umask 022

for script in /etc/profile.d/*.sh ; do
    if [ -r $script ] ; then
            . $script
    fi
done
echo "hello"
Related Posts Related Posts :
  • Using MySQL for autocomplete fields
  • how can I use this mysql query in elastic search
  • Implement IF in MySQL SUM Timestamps difference
  • Optimize query from view with UNION ALL
  • Mysql stop words and match
  • Using tinyint as datatype in MySQL 5.5.57
  • Mysql select match and unmatched records from two different tables by comparing more then two columns
  • Connecting to Docker MySQL using MySQL Workbench
  • how to select all newest records for all users
  • mySQL stored procedure not giving me error messages
  • MySQL does FK reduce insert/update operations?
  • Select column by alias in MySQL
  • Query displays different data each time I run it in Mysql
  • MYSQL: Query 2 tables with union is very slow, how to improve?
  • How to make this query in sqlalchemy?
  • Why is mySQL able to resolve these column aliases when normally one can't reuse an alias?
  • Laravel Query using GroupBy with distinct traits
  • Checking for multiple values in multiple columns, sql select
  • MySQL: modeling for 90 yes or no questions survey with statistics support
  • add column with range limit , values of that column must not be specific values
  • How can I collaborate with multiple developers on a Joomla project?
  • How to store a time_t field to MySQL datetime?
  • How can I simplify / alias this SQL query
  • Date Format issue STR_TO_DATE('18:11:52', '%H:%i:%s') Returns NULL
  • Can't parse JSON returned from MySQL
  • SQL select where value not matched
  • Why use Unique when Primary key on same key is already defined
  • SELECT UUID() inside an insert statment MySQL
  • Query cf queryObject and insert into table
  • search List of string spring Data MySQL
  • MySQL CURSOR not fetching desired rows
  • SQL grouping averages
  • how to join three tables without duplication in sql?
  • Im unable to find the error with mysql code
  • process sub query which returns multiple rows for each row. Db: Mysql, sql
  • Fetch the response from sql, store it in a object and use conditions?
  • deleting a row in a table
  • What Index do I need to write to prevent table-sort in a non-performant MySQL query?
  • MySQL: how to query to show answers of two users side by side
  • Foreach for MySQL (In Trigger)
  • Joining two table in one condition
  • Error: MySQL shutdown unexpectedly - XAMPP
  • Ordering issue when using SQL variable
  • MySQL Where on Multiple Left Join Rows
  • joining 3 or more table and sum the fields
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com