How to give dynamic file name in the appender in log4j.xml

It’s much easier to do the following: In log4j.xml define variable as ${variable}: <appender name=”FILE” class=”org.apache.log4j.FileAppender”> <param name=”File” value=”${logfilename}.log” /> <layout class=”org.apache.log4j.PatternLayout”> <param name=”ConversionPattern” value=”%d::[%t]::%-5p::%c::%x – %m%n” /> </layout> </appender> Then make sure you set the system property when you start your JVM such as: java -Dlogfilename=my_fancy_filename example.Application That will create a dynamic log file … Read more

Why no variable size array in stack?

Variable Length Arrays(VLA) are not allowed in C++ as per the C++ standard. Many compilers including gcc support them as a compiler extension, but it is important to note that any code that uses such an extension is non portable. C++ provides std::vector for implementing a similar functionality as VLA. There was a proposal to … Read more

How to design these two tables?

**Form** A Form Template —- formID (PK) authorID Name **FormField** = 1 row for each new question on the form ———- FormFieldID (PK) FormID (FK) FieldID (FK) SortOrder INT **FormFieldOptions** – if the form field is a selectbox this will store the options availble to pick from ————— FormFieldID (fk) Name SortOrder INT **Field** — … Read more

tech