I've installed ruflin/elastica bundle to use with monolog in a Symfony 2.8 installation.
I was wondering if there would exist a tutorial to configure LogStash in order to use monolog generated logs.
At least I don't understand if basic input type is http, ftp or even udp.
Moreover, filter could be a defined one or should I create my own filter to capture standard symfony logs?
Related
I want to use the Symfony web server for local development, but I'm surprised that Symfony actually comes with two servers:
the Symfony local web server - started with symfony server:start
the Web Server Bundle - started with bin/console server:start
I find it very confusing to have these 2 options, as the docs do not seem to give you any hint as to why you should use one over the other and under which circumstances.
As far as I can see, it looks like the Web Server Bundle (bin/console server:start):
is just a wrapper around PHP's built-in web server
is installed using Composer
while the Symfony local web server (symfony server:start):
is a full-fledged web server
must be installed as standalone (as part of the symfony command)
Still, I can hardly understand why they do release these 2 options. At first glance it looks like the Symfony local web server is more powerful; in this case why would they release the webserver bundle as well?
As mentioned in the Web Server Bundle docs:
Deprecated since version 4.4: This article explains how to use the WebServerBundle to run Symfony applications on your local computer. However, that bundle is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.
Instead of using WebServerBundle, the preferred way to run your Symfony applications locally is to use the Symfony Local Web Server.
So the recommended way is to use symfony server:start to serve an app in development.
Thanks to #Cerad and #Jakub Matczak for their comments.
Prestashop 1.7+ is based on Symfony.
Symfony local environment debug mode means, that you runs command "php app/console (or bin/console at Symfony v3+) server:run" to start local webserver emulation and to view your project with local browser at localhost address (e.g. 127.0.0.1) without any WAMP, MAMP, XAMPP etc.
Also, local debug mode means, that you use app_dev.php prefix to view site in debug mode (with error and performance reports, profilers and other cool symfony features)
There is also commands in Symfony like "php app/console (or bin/console at Symfony v3+) doctrine:schema:validate)", to validate if Doctrine entities model correlate with Mysql database.
So my questions are:
Is Prestashop 1.7+ support "php app/console (or bin/console at Symfony v3+) server:run"?
Is Prestashop 1.7+ support Symfony app_dev.php debug mode?
Should I use "php app/console (or bin/console at Symfony v3+) doctrine:schema:validate)" to ensure that model and database are correct?
Are there any plans to use Twig instead of Smarty?
Thanks.
Prestashop 1.7 only uses very few symfony components mainly for the backoffice product listing and the modules page.
You cannot use any of the symfony commands as the app/console is not included.
Also even though going through the source files you will find doctrine the doctrine entities are not used anywhere so you cannot validate the schema.
Twig is only used in the backoffice on the 2 pages I mentioned earlier.
All in all you won't really stumble upon any symfony unless you go into the core code and you cannot (easily) include any bundles or use any Symfony commands.
We are using DropWizard to create java applications running as a server inside a docker container.
Command to create such applications is as below -
java -jar service-name.jar server service-name.yml
service-name.yml is a file that holds all configuration settings.
Can you suggest how do we configure application insights inside this yml file?
I don't know how DropWizard configuration reading works. But if there are hooks in the code to read the configuration, you can read all the configuration required for ApplicationInsights and manually configure in your code using TelemetryInitializers.
I am deploying a Spring Boot application to AWS Elastic Beanstalk using AWSCLI. I want to put an external application.properties file containing customer specification configurations (database credentials, etc.) in the same directory of the application. The application should pick up this properties file. How can I accomplish that? Are there any alternatives?
Spring Cloud Config
This project allows you to use an external, centralized configuration repository for one or more applications. You don't need to rebuild your application if a property changes. You can simply change the property in your configuration repository and even push the changes to all of your applications.
See this Getting Started Guide.
This above approach is what I would recommend for the scenario you described. I would not bother with having a separate directory on the application server for your configuration files. Spring Cloud Config is a great approach as it solves the problem you described and a few more.
You can alternatively specify them in an application-prod property like
server.port=5000
spring.datasource.url=jdbc:mysql://${RDS_HOSTNAME}:${RDS_PORT}/${RDS_DB_NAME}
spring.datasource.username=${RDS_USERNAME}
spring.datasource.password=${RDS_PASSWORD}
spring.jpa.hibernate.ddl-auto=create
and specify an environment variable called SPRING_PROFILES_ACTIVE with the value prod making the beanstalk smart enough to pick values from out there.
I am following the Cloudify user guide - its pretty easy to follow, and have installed a local deployment successfully.
Now I want to add users and passwords to the web management interface, how to do this? By default, the web interface supports anonymous login.
Assuming your aim is to obtain full control over deployments, use the Cloudify shell (or "Cloudify CLI").
As the Cloudify shell currently exposes read-only operations, it does not require login details. Configuring secured access for the REST API, however, can be done using spring security (which will be documented soon).